How to execute multiple classes at once using TestNG?

0 votes
I have just started learning selenium and was wondering that if there is a possible way of executing multiple classes at once in TestNG?

Can someone help?
Dec 26, 2018 in Selenium by Sradha
• 1,720 points
155 views

1 answer to this question.

0 votes

Hey @Sradha, Yes it is possible in TestNG.

All you need to do is create a XML file and list all the different class you want to test at once.

Here is the syntax:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >

<suite name = "TestNG">

    <test = "Testing TestNG">
    
        <classes>
        
            <class name = "testNG.class1"/>
            <class name = "testNG.class2"/>
            <class name = "testNG.class3"/>
            
        </classes>
        
    </test>

</suite>

This way you can run the test cases in each class at once.

answered Dec 26, 2018 by Rashmi

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

Need to perform parallel execution (multiple browser sessions) with Selenium & TestNG by using @BeforeSuite

@Beforesuite annotated method runs before the testNG.XML ...READ MORE

answered Mar 30, 2018 in Selenium by nsv999
• 5,110 points
1,592 views
0 votes
1 answer

How to Stop a For-Loop at a special number using Python

driver.find_elements_by_tag_name() returns a list of WebElements. You can use options ...READ MORE

answered May 25, 2018 in Selenium by Samarpit
• 5,130 points
37 views
+1 vote
1 answer
0 votes
1 answer

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,110 points
1,016 views
0 votes
1 answer
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,130 points
1,158 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
895 views
0 votes
1 answer
0 votes
1 answer