How to run a group of test cases using TestNG in Selenium Webdriver

0 votes
How to run a group of test cases using TestNG in Selenium Webdriver?
Jun 12, 2019 in Selenium by Kajal
2,692 views

1 answer to this question.

0 votes

Hey Kajal, TestNG allows you to perform ordered groupings of test methods. You can not only declare that methods belong to groups, but you can also specify groups that contain other groups. Then TestNG can be invoked and asked to include a certain set of groups while excluding another set.  This gives you maximum flexibility in how you partition your tests and doesn’t require you to recompile anything if you want to run two different sets of tests back to back. 

Groups are specified in your testng.xml file and can be found either under the <test> or <suite> tag. Groups specified in the <suite> tag apply to all the <test> tags underneath.

@Test (groups = { "smokeTest", "functionalTest" })
public void loginTest(){
System.out.println("Logged in successfully");
}
answered Jun 12, 2019 by Abha
• 28,140 points

Related Questions In Selenium

0 votes
2 answers

Can anyone help me that how to run Selenium WebDriver test cases in Chrome?

You first need to download chrome driver ...READ MORE

answered Aug 26, 2019 in Selenium by Abha
• 28,140 points
1,655 views
0 votes
8 answers

How to open a link in new tab of chrome browser using Selenium WebDriver?

This below code works for me in ...READ MORE

answered Dec 14, 2020 in Selenium by Gitika
• 65,910 points
101,349 views
0 votes
1 answer

How to pass parameter through testng.xml file to a test case in Selenium Webdriver?

Hello Revathi, to pass parameter through testng.xml ...READ MORE

answered Jun 12, 2019 in Selenium by Abha
• 28,140 points
7,238 views
0 votes
2 answers

How to scroll a Web Page using coordinates of a WebElement in Selenium WebDriver ?

JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("window.scrollBy("X", " y ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
5,679 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
12,577 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
8,559 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
6,606 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,506 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