I am trying to set up Webdriver parallel execution with Webdriver Hub and TestNG parallel mechanism. I am facing an issue with thread
I have this class which extends TestBaseSetUp, which has a BeforeMethod and AfterMethod and set to run always. For webdriver parallel execution, I wanted to use ThreadLocal, but @Test and @Before/@After method are in different thread.So If I set webdriver as ThreadLocal in my TestBaseSetUp, and try get in my test method it returns null.
public class TestCheck extends TestBaseSetUp {
@Test
public void test(){
System.out.println("Thread in test " + Thread.currentThread().getId());
} }
Do we have a way so that @Test is also in same thread as @Before/@After method