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,760 points
903 views

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 "http://testng.org/testng-1.0.dtd" >

<suite name = "TestNG">

    <test name = "Testing TestNG">

    <groups>

        <run>

        <include name = "A"/>

        <include name = "C"/>

        </run>

    </groups>

    <classes>

        <class name = "testNG.Test1"/>

        <class name = "testNG.Test2"/>

        <class name = "testNG.Test3"/>

    </classes>

    </test>

</suite>

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
87,359 views
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,610 points
4,235 views
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
13,649 views
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
9,131 views
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,910 points
7,209 views
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
7,865 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP