Skip to content

2022.12.22

Compare
Choose a tag to compare
@KMariusz KMariusz released this 22 Dec 12:57
· 46 commits to develop since this release

Selenium

  • CustomStrategy for JUnit

There is known issue related with running JUnit 5 + Selenium 4 test cases.
As a workaround MrChecker has now CustomStrategy class implementation which should let you run your test cases parallel without any issues.
In your test projects pom file you need to usefollowing junit parameters for custom strategy.

junit.jupiter.execution.parallel.enabled=true
junit.jupiter.execution.parallel.mode.default=${parallel.mode.default}
junit.jupiter.execution.parallel.mode.classes.default=${parallel.mode.classes.default}
<!--This doesn't work for JUnit + Selenium 4-->
<!--junit.jupiter.execution.parallel.config.strategy=fixed-->
<!--junit.jupiter.execution.parallel.config.fixed.parallelism=${thread.count}-->
<!--Use CustomStrategy-->
junit.jupiter.execution.parallel.config.strategy=custom
junit.jupiter.execution.parallel.config.custom.class=com.capgemini.mrchecker.selenium.junit.CustomStrategy

Then you should be able to execute your tests parallel with fixed thread count using parameter (10 as example):
-Dthread.count=10