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
2,585 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,140 points
7,663 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,140 points
2,926 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
• 59,230 points
1,256 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,910 points
1,156 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,673 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,142 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,221 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,874 views
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