简体   繁体   中英

WebDriver: How to deal with parallel test execution using the same browser (Firefox)?

WebDriver: How to deal with parallel test execution using the same browser (Firefox)?

  1. i need to execute many tests and many instances of the same browser however im having problems with cookies because the browsers are sharing the cookies used.

  2. Possible to resolve the issue using browser / firefox profiles?

thanks for your help

  1. Delete cookies before every test using driver().manage().deleteAllCookies()
  2. Create new webdriver instance for every test
  3. When running in parallel use forks instead of threads, refer to this article for more details: http://maven.apache.org/surefire/maven-surefire-plugin/examples/fork-options-and-parallel-execution.html - also you're able to use forks in testNG

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM