java - Multiple WebDriver instances in Selenium without Grid? -
Is it possible to use many Selenium WebDriver without using the Selenium grid to run multiple tests at the same time?
I am creating many code at The driver has been created and destroyed it JUnit The methods shown below are a web driver for each test class but each test case has a different execution period. And before the end of the test class and org.openqa.selenium.remote.SessionNotFoundException: FirefoxDriver can not be used after dropping information: Version: '2.39.0', revision: '14fa800511cc5d66d426e08b0b2ab926c7ed7398', Time: '2013-12-16 13:18:38' System Info: Host: 'T61', IP: '127.0.1.1', OS. Name: 'Linux', os.arch: 'i386', overson: '3.11.0-15-generic', Java version: '1.7.0_51' then using different driver variables Try different examples: Example: new firefoxdriver () , but windows sessions interfere with each other.
@BeforeClass Public Stable Zero Set Up Class (Driver) = New Firefox Driver (); } @AfterClass Public Stable Zero TierDownClass () {driver.quit (); // it should only kill the current driver}
Import org.openqa.selenium.WebDriver; Import org.openqa.selenium.firefox.FirefoxDriver; Import org.testng.annotations.BeforeClass; Import org.testng.annotations.Test; Public class test {WebDriver driver1, driver2; @BeforeClass public before zero () {driver1 = new FirefoxDriver (); Driver2 = new firefox driver (); } @Test Public Zero Test 1 () throws interrupted expeditions {driver1.get ("http://www.google.com"); Driver2.get ("http://gmail.com"); } @ Org.testng.annotations.AfterClass class after class zero () {driver1.quit (); }}
Comments
Post a Comment