--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/49c486fb-f668-4f48-a917-4d7fb8094170%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
Have your @BeforeMethod initialize a ThreadLocal variant of the WebDriver instead of the class level data member.
Change: public WebDriver driver;
To: private static final ThreadLocal<WebDriver> driver = new ThreadLocal<>();
Change: driver = new ChromeDriver();
To: driver.set(new ChromeDriver());
Create a method such as the one below to get access to the driver object :
private WebDriver getDriver() {
return driver.get();
}
And use “getDriver()” instead of “driver” through-out your code.
Thanks & Regards
Krishnan Mahadevan
"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/bc0e9360-4d8b-46ee-bf11-fbca5f59576f%40googlegroups.com.