How to execute groups of similar name for multiple classes

0 votes
How can I run the test cases grouped as one in different class? I am not understanding as how that can be achieved?

Can someone help?
Dec 27, 2018 in Selenium by Sradha
• 1,750 points

1 answer to this question.

0 votes

Hello @Sradha, 

You can create a TestNG suite to do that. This is also done in a similar way as used to run multiple class. All you need to do is create a XML file and then mention all the classes that you want to run, mention the group that you want to test. That's all. Here is an example for the same:-

<!DOCTYPE suite SYSTEM "" >

<suite name = "TestNG">

    <test name = "Testing TestNG">



        <include name = "A"/>

        <include name = "C"/>




        <class name = "testNG.Test1"/>

        <class name = "testNG.Test2"/>

        <class name = "testNG.Test3"/>




Hope this helps.

answered Dec 27, 2018 by Trisha

Related Questions In Selenium

0 votes
3 answers

How to print text from a list of all web elements with same class name in Selenium?

Try using List <WebElement> to access all similar elements ...READ MORE

answered Dec 16, 2020 in Selenium by Roshni
• 10,480 points
0 votes
1 answer
+1 vote
1 answer
+1 vote
1 answer

How to get the following-sibling element for a table type of structure

Why do you want to use the ...READ MORE

answered Apr 9, 2020 in Selenium by Karan
• 19,620 points
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
0 votes
1 answer
0 votes
1 answer