Please help how to run the test cases with out closing the browser.
public class Startofpage
public IWebDriver driver;
public void StartTest()
driver= new OpenQA.Selenium.IE.InternetExplorerDriver();
public void Incident1()
public void Incident2()
I need hlep on how to run the test cases one by one without closing the browser opened in the test fixure.
Please help urgently
Instructorgunjan Reply on 01/02/2019
Write driver.quit() command in the [TearDown] annotation in the class which will close the browser once after the execution of all the [Test] methods.
My Porblem is I donot want to close the current browser untial i finish running all the test cases. Currently the default behaviour of the test initialize method is to run each time before all the test. Which i donot want. I want the initialize method to be run only once till my all test methods finish run. Please help on this. The brower should open only once and run all the test method (Test1,Test2,Test3....Test N) then the driver.quit mehtod should only run. Please help i need it urgently in my office. A request.
Thanks in Adv,
Instructorgunjan Reply on 05/02/2019
If you want to open browser only once, then you keep the code to open the browser in the [SetUp] annotation and the respective tests in the [Test] annotation and then the quit command in the [TearDown] annotation.