Parameterized Selenium Tests in Parallel with TestNG

前端 未结 2 561
伪装坚强ぢ
伪装坚强ぢ 2020-12-09 13:34

First of all, sorry for my english, it\'s not so perfect :)

So I\'m facing with the following problem: I\'m trying to run parallel tests in different browsers using

相关标签:
2条回答
  • 2020-12-09 14:25

    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(...)

    0 讨论(0)
  • 2020-12-09 14:28

    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;
    
    0 讨论(0)
提交回复
热议问题