Reputation: 101
I made a test script that is way to long. So, i'm making short classes. if i want to run a few in a row (with TestNG xml file) the first class will succeed, but the next one opens a new firefox window because of:
WebDriver driver = new FirefoxDriver();
How do I make it so that it won't open a new window but goes on in the same window as the previous class?
Upvotes: 0
Views: 918
Reputation: 381
This might be workaround, you can used in you code, @AfterClass public closedBrowser() { driver.close(); }
So that next class is opened freshly in new browser. Write a 'driver.close()' in After class.
Upvotes: 2
Reputation: 5113
This has been answered many times before, but here is one I posted the other day. In a nutshell:
Upvotes: 2