Selenium Framework for Beginners 23 | TestNG Grouping | How to group tests

  Рет қаралды 33,374

Automation Step by Step

Automation Step by Step

Күн бұрын

Пікірлер: 75
@shafeekmuhammed1175
@shafeekmuhammed1175 2 жыл бұрын
Hello Raghav, Your videos helped me a lot to get a JOB in Accenture as "Test Automation lead" 7 months before . and am so happy in my work . If i have some doubts on any area I come back and refer your video again :)
@RaghavPal
@RaghavPal 2 жыл бұрын
All the best Shafeek
@ashesds1
@ashesds1 4 жыл бұрын
One interesting point. If you have methods annotated with BeforeTest,BeforeSuite etc they will not be run automatically if they are not included in the groups also. If we want the setup and tear down methods to run irrespective of your group classifications we could use alwayrun=true for the Before and after methods
@RaghavPal
@RaghavPal 4 жыл бұрын
Thanks for the inputs Ashes
@luv966
@luv966 Жыл бұрын
Thank you !!! i don't even want to know how long i would be trying to find out, whats wrong .. again... 🤬😅
@ravikumarshallagi9755
@ravikumarshallagi9755 5 жыл бұрын
There is a typo in d test for Regression vs xml not sure if exclude worked correctly. vl hv to check ourselves to see.. You r doing good job.. Thanks for d content..
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi Ravi, will check it. Thanks for your message
@aakash3940
@aakash3940 3 жыл бұрын
@@RaghavPal It got excluded.
@prashantht.v8289
@prashantht.v8289 5 жыл бұрын
Very neat and crisp explanation.. Very good job.
@RaghavPal
@RaghavPal 5 жыл бұрын
Thanks for watching Prashanth
@RaghavPal
@RaghavPal 5 жыл бұрын
Thanks for watching Prashanth
@TahayariDan
@TahayariDan 5 жыл бұрын
This actually was useful ! Thank you very much for making this video and this playlist.
@RaghavPal
@RaghavPal 5 жыл бұрын
You're welcome Tahayari
@akhildas6393
@akhildas6393 2 жыл бұрын
Very good👍
@RaghavPal
@RaghavPal 2 жыл бұрын
Thank you very much
@nagalakshmikothuru6603
@nagalakshmikothuru6603 Жыл бұрын
really wonderfull series...very much seful to me...thank u
@RaghavPal
@RaghavPal Жыл бұрын
You are most welcome
@AC-vt1nq
@AC-vt1nq 2 жыл бұрын
Excellent!!
@RaghavPal
@RaghavPal 2 жыл бұрын
thanks
@smitavharavadekar7578
@smitavharavadekar7578 3 жыл бұрын
Thank you for in detail explained.
@RaghavPal
@RaghavPal 3 жыл бұрын
You are welcome Smita
@shafeekmuhammed1175
@shafeekmuhammed1175 3 жыл бұрын
Thank you
@RaghavPal
@RaghavPal 3 жыл бұрын
You're welcome Shafeek
@fezacell2426
@fezacell2426 5 жыл бұрын
There is a type on the multiple group example. If a test method belongs to both included and excluded group, the excluded group takes the priority and the test method will be excluded from the test execution.
@RaghavPal
@RaghavPal 5 жыл бұрын
Thanks for info addition
@ChandraShekar-nu8yq
@ChandraShekar-nu8yq 5 жыл бұрын
very nice and clear thanks a lot...
@RaghavPal
@RaghavPal 5 жыл бұрын
You're welcome Chandra
@EasyWayLearn
@EasyWayLearn 4 жыл бұрын
great explaination
@RaghavPal
@RaghavPal 4 жыл бұрын
Thanks Mahendra
@kishore76dhaka
@kishore76dhaka 4 жыл бұрын
God Bless you my friend
@RaghavPal
@RaghavPal 4 жыл бұрын
Thanks for the wishes Towhid
@dipankarnag9537
@dipankarnag9537 5 жыл бұрын
Nice Explanation sir
@RaghavPal
@RaghavPal 5 жыл бұрын
Thanks Dipankar
@dineshmohanty4966
@dineshmohanty4966 2 жыл бұрын
Hello Raghav, I was wondering if its possible to execute certain tests only when the combination of groups match. For example, if one test has groups as "app" and "sanity" And There are other test methods present as well in the project/class. I want to executive tests which have "app" And "sanity" tags only and tests which have only app or sanity tags shouldn't run, is this possible? If so could you share some reference please? Thank you in advance.
@RaghavPal
@RaghavPal 2 жыл бұрын
Hi Dinesh, you can create a separate testng.xml file and in that include the groups you need, So when you run this file, only the included groups will execute This link has good examples - www.javatpoint.com/testng-groups
@virenkumar3848
@virenkumar3848 4 жыл бұрын
love u bro thanx thanx..
@RaghavPal
@RaghavPal 4 жыл бұрын
You're welcome Biren
@divyangjani7600
@divyangjani7600 5 жыл бұрын
excellent
@RaghavPal
@RaghavPal 5 жыл бұрын
Thanks for watching Divyang
@hukamchand330
@hukamchand330 4 жыл бұрын
Hi Raghav, Very good explanation. I have one question, something like this we can using "Batch" in testNG. What is the difference between batch and groups and when to use which one ?
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Hukam, can you show me some example or link where batch is used, so I can refer and check
@svpradeep
@svpradeep 4 жыл бұрын
Hello Raghav, thanks for the above, clarification - can we club groups+parameters for parallel testing on testng.xml and run them
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Pradeep, you should be able to do that. Pls try
@pujasaha5452
@pujasaha5452 2 жыл бұрын
Hi Raghav..Thank u for the amazing content. Is it possible to control test case execution from datasheet instead of groups. Like can we provide in the datasheet with a column named"Execution Required" with value"Y/N" for each test case name.
@RaghavPal
@RaghavPal 2 жыл бұрын
Yes, Puja you can do, will have to add script for that
@karnataka8863
@karnataka8863 Жыл бұрын
Group tag comes between suite and test tag right ?
@RaghavPal
@RaghavPal Жыл бұрын
Hi, In TestNG, the tag can be used at both the level and the level to group test methods together. At the level, the tag can be used to specify which groups of test methods should be included or excluded from the entire suite of tests. e.g. ... At the level, the tag can be used to specify which groups of test methods should be included or excluded from a specific test. e.g. In short, The tag can be used at both the level and the level in testng.xml file
@karnataka8863
@karnataka8863 Жыл бұрын
@@RaghavPal tq
@philb4462
@philb4462 11 ай бұрын
Thanks for another great video. There's something I'm stuck on. I have a class with multiple tests in it as per your example here. The results that get reported on the HTML report say the number of tests run is 1. It equates running one class with running one test when it reports. Is it possible to get it to report three tests run when I run one class with three tests in it, as per your example?
@RaghavPal
@RaghavPal 11 ай бұрын
Phil Yes, it is possible to get your test report to report three tests run when you run one class with three tests in it. To do this, you need to use a different test reporting tool. The default test reporting tool in Selenium Java is the JUnit test runner. The JUnit test runner only reports the number of test classes that were executed, not the number of test methods. To get a more detailed test report, you can use a different test reporting tool, such as TestNG or Allure Report. TestNG and Allure Report can both report the number of test methods that were executed, as well as the number of test classes. To use TestNG or Allure Report with Selenium Java, you need to add the appropriate dependency to your project. You can do this using Maven or Gradle. Once you have added the TestNG or Allure Report dependency to your project, you need to configure your test classes to use the appropriate test runner. To do this, you can use the `@Test` annotation. Here is an example of how to configure a test class to use the TestNG test runner: ```java import org.testng.annotations.Test; public class MyTestClass { @Test public void test1() { // ... } @Test public void test2() { // ... } @Test public void test3() { // ... } } ``` To run your test class using TestNG, you can use the following command: ``` testng MyTestClass.java ``` To run your test class using Allure Report, you can use the following command: ``` allure generate allure-results --clean -o allure-report ``` Once you have run your test class, you can view the test report in your web browser. The test report will show you the number of test methods that were executed, as well as the number of test classes. I hope this helps
@philb4462
@philb4462 11 ай бұрын
@@RaghavPal Thank you so much for your detailed reply. What you wrote is what you showed in your video. That uses TestNG and so did I. When I open the html report it says 1 test was run despite it being 3 tests in 1 class. It reports class numbers and calls them tests while not reporting actual test numbers. That is TestNG doing that. I think it's because in the .xml file that class sits in a single tag. I need multiple such tags with different classes in them to show I want multiple tests reported. By doing that, I get multiple browser windows opening which is slower and potentially overloads the computer if I have hundreds of tests. My guess it what I'm hoping for is just not how TestNG works. I don't know why though. It seems fairly obvious to me that a class is not the same thing as a test, yet that's how it's categorised in the html report.
@RaghavPal
@RaghavPal 11 ай бұрын
may be the case, if I get to know more on this will share
@philb4462
@philb4462 11 ай бұрын
@@RaghavPal Thank you. I really appreciate your fantastic channel. 👍
@basirobaidi667
@basirobaidi667 5 жыл бұрын
Thank you. Q? How to execute test cases from multiple classes using group?
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi Basir, you should be able to run them using testng.xml file. There are some videos to help - kzbin.info/aero/PLhW3qG5bs-L8oRay6qeS70vJYZ3SBQnFa
@danieljesu8726
@danieljesu8726 3 жыл бұрын
What is the difference by adding groups in test level vs suite level...Even though you explained in words ...I am not getting that part. Please explain with some example while reply .Thanks!
@RaghavPal
@RaghavPal 3 жыл бұрын
Hi Daniel, sure, I will plan to add more examples
@Rahulsingh-wu4ni
@Rahulsingh-wu4ni 4 жыл бұрын
Sir, I have created a TestNG class or XML file but out is coming not correct. And I also use include in XML is still not working.
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Rahul, will need to check the setup and logs
@ankitathakur1930
@ankitathakur1930 4 жыл бұрын
Hi Raghav, Here you have all @test annotation in a single class file. My question is if there are... lets say 100 class files, then does all need to be included in class tag ...can we have groups for classes?
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Ankita, yes, we can create groups as we like and also do tagging
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Ankita, yes, we can create groups as we like and also do tagging
@somanagurthisusmita6648
@somanagurthisusmita6648 Жыл бұрын
@raghavpal I have the same question . do we need to include multiple class names in the testng.xml?
@divyangjani7600
@divyangjani7600 4 жыл бұрын
what if there one group defined at class level . but one of method inside that class we are excluding it from testng.xml now if we run class will it run that method too? because method we are excluding but it is still under that class???
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Divyang, I will need to try this. Can you try and check what happens
@AmitKumar-pc8wr
@AmitKumar-pc8wr 4 жыл бұрын
Hi Raghav. Thanks for the video. Need help on this. I want to take group tags from my properties file. How to achieve that.
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi Amit, are you talking about parameterising the tags. Will need to check online
@justforyou9630
@justforyou9630 4 жыл бұрын
Hello sir, my groups does not work if we have before annotation , non of the before annotation execute if we do grouping . any solution other than Always = true?
@RaghavPal
@RaghavPal 4 жыл бұрын
Hi, I checked online and looks like enabling the attribute alwaysRun=true is the solution for this. I will check more and update if I find anything on this stackoverflow.com/questions/46405840/before-suite-and-beforetest-methods-are-not-called-if-groups-are-executed-in-t
@jneeraj2011
@jneeraj2011 5 жыл бұрын
i am not getting auto suggest in testng.xml file ..please suggest raghav.
@RaghavPal
@RaghavPal 5 жыл бұрын
Hi Neeraj, can try to restart eclipse
@agreeamerica7620
@agreeamerica7620 5 жыл бұрын
@@RaghavPal I have the same issue on my Mac and tried to restart eclipse but didn't work.
@Deniz-ss1sv
@Deniz-ss1sv 3 жыл бұрын
:)
Selenium Framework for Beginners 24 | TestNG How to use Parameters | in Selenium
7:59
An Unknown Ending💪
00:49
ISSEI / いっせい
Рет қаралды 8 МЛН
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 153 МЛН
АЗАРТНИК 4 |СЕЗОН 1 Серия
40:47
Inter Production
Рет қаралды 1,3 МЛН
Taking ScreenShot ONLY for Failed Tests in Selenium using TestNG Listener
32:12
Naveen AutomationLabs
Рет қаралды 117 М.
Selenium Framework for Beginners 34 | How to add project to GitHUB
12:10
Automation Step by Step
Рет қаралды 32 М.
TestNG Interview Questions and Answers || TestNG Framework Interview Questions
48:57
Cursor Is Beating VS Code (...by forking it)
18:00
Theo - t3․gg
Рет қаралды 67 М.
Selenium Framework for Beginners 39 | How to run Selenium tests on Jenkins
10:33
Automation Step by Step
Рет қаралды 80 М.