Chandresh Mishra
Chandresh Mishra

Reputation: 1179

Serenity BDD / Selenium Test works 6 out of 10

Sometime test case pass and sometime it fails with the error

Caused by: net.thucydides.core.webdriver.DriverConfigurationError: Could not instantiate new WebDriver instance of type class org.openqa.selenium.chrome.ChromeDriver (unknown error: DevToolsActivePort file doesn't exist
  (Driver info: chromedriver=74.0.3729.6 (255758eccf3d244491b8a1317aa76e1ce10d57e9-refs/branch-heads/3729@{#29}),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 60.31 seconds
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'W10Y3J82', ip: '169.24.151.78', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_192'
Driver info: driver.version: ProvideNewDriver). See below for more details.

I am using serenity BDD with selenium.

    <serenity.version>2.0.54</serenity.version>
    <serenity.maven.version>2.0.54</serenity.maven.version>
    <serenity.cucumber.version>1.0.14</serenity.cucumber.version>
    <cucumber.version>4.2.0</cucumber.version>

When it fails I can see chromeDrive.exe and chrome.exe left running in Task manager.

Am I doing something wrong or selenium test cases are fragile?

Runner code

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
        plugin = {"pretty"},
        features = "src/test/resources/features",
        glue = {"starter"},
        tags = {"not @avoid"}
)
public class CucumberTestSuite {

}

serenity.conf

chrome.switches="""--start-maximized;--test-type;--no-sandbox;--ignore-certificate-errors;
                   --disable-popup-blocking;--disable-default-apps;--disable-extensions-file-access-check;
                   --incognito;--disable-infobars,--disable-gpu"""

Upvotes: 0

Views: 1376

Answers (3)

Chandresh Mishra
Chandresh Mishra

Reputation: 1179

This is what worked for me

serenity.restart.browser.for.each=NEVER

Added this in serenity.properties file.

Upvotes: 0

rusu dan
rusu dan

Reputation: 21

use this line in serenity.conf

serenity.restart.browser.frequency

I think by default is set to false

Upvotes: 0

Chandra Shekhar
Chandra Shekhar

Reputation: 664

Change this chrome settings : go to

`chrome://settings/ ->
 Advanced ->
 Continue running background apps when Google Chrome is closed`

switch off that option, restart and run the tests

Upvotes: 0

Related Questions