cmccarthyIrl / spring-cucumber-testng-parallel-test-harness

This project executes Cucumber tests sequentially or in parallel using TestNG, Spring, Cucumber, Java, Logback and Extent Reports to provide a basic test harness. Rest Assured and Selenium test examples are provided
MIT License
16 stars 6 forks source link

Session ID is coming as null , #4

Closed automatenew closed 2 years ago

automatenew commented 2 years ago

Set the parallel to false for single thread execution

public class WeatherRunnerTest extends AbstractTestNGCucumberTests { @Override @DataProvider(parallel = false) public Object[][] scenarios() { return super.scenarios(); }

[INFO] Run 1: PASS [ERROR] Run 2: WikipediaParallelRunnerTest.runScenario » NoSuchSession Session ID is null. Us... [ERROR] Run 3: WikipediaParallelRunnerTest.runScenario » NoSuchSession Session ID is null. Us...

how to limit the number of threads, please let me know.

Thanks for the greater work

cmccarthyIrl commented 2 years ago

WebDriverRunner is closing the drivers session after each test when parallel = false. The Selanide dependency should be removed and replaced with driverThreadLocal instance, in the DriverManger.class. Feel free to open a PR if you fix it.

cmccarthyIrl commented 2 years ago

Have a look at this commit : https://github.com/cmccarthyIrl/spring-cucumber-testng-parallel-test-harness/tree/b55a071801d4b7240ad077544bdd98c6908d3aaa/wikipedia/src/test/java/com/cmccarthy/ui