Execute two separate test cases in the same browser instance using TestNG xml file

0 votes
I have two testcases in two separate java classes, 1. login and 2. add new item. I want to execute both as separate testcases under the same browser instance. Ideally one browser window will open, and execute the login testcase. After login, the second testcases will continue to execute under the same browser. I am currently using TestNG xml file to run these tests. Following is the <classes> tag within xml file that contains both classes.

<classes>

<class name="com.SeleniumFramework.testCases.TC_Login" />

<class name="com.SeleniumFramework.testCases.TC_AddItem" />

</classes>
Jul 23, 2019 in Selenium by Jimmy
• 130 points
1,011 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Selenium

0 votes
1 answer
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,000 points
3,839 views
0 votes
1 answer

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

Hey Kajal, TestNG allows you to perform ordered ...READ MORE

answered Jun 12, 2019 in Selenium by Abha
• 28,000 points
1,467 views
0 votes
1 answer
0 votes
1 answer

Using the same in IE browser but getting half the screen as black and half is coming

You could probably give a try making ...READ MORE

answered May 4, 2020 in Selenium by Sirajul
• 58,990 points
299 views
0 votes
1 answer

Maximizing the browser window in Selenium WebDriver using C#

Check this first: http://code.google.com/p/selenium/issues/detail?id=174 You Can use the JavascriptExector as follows: public ...READ MORE

answered May 2, 2018 in Selenium by Samarpit
• 5,890 points
253 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,520 points
4,590 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,010 points
5,458 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,890 points
3,284 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 2, 2020 in Selenium by Sri
• 3,010 points
3,866 views