Parameterized Selenium Tests in Parallel with TestNG

喜你入骨 提交于 2019-11-28 08:45:47

Don't make the fields static.

private static List<WebDriver> webDriverPool = Collections.synchronizedList(new ArrayList<WebDriver>());
private static ThreadLocal<WebDriver> driverThread;
public static BrowserSetup browser;

beforeTest() and afterTest() shouldn't be static if you want to run it in parallel, or make it synchronized to have it thread safe. Also, you do not use declared variable:

public static BrowserSetup browser; 

at all, or you missed something there since you also have:

final BrowserSetup browser = new BrowserSetup(browserName, browserVersion, platform);

inside beforeTest(...)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!