0

I am working on Selenium test case using the chromedriver and mocha. Following is the part of my package.json file:

"chromedriver": "^2.46.0",
"mocha": "^5.2.0",
"selenium-standalone": "^6.16.0",
"selenium-webdriver": "^4.0.0-alpha.1",
"webdriver-manager": "^12.1.1"

I am running the test cases using ChromeDrive.exe file having version 73.0.3686. All test cases are running locally or throwing an error but behavior on Jenkins is totally different.

On Jenkins, I am running the following error more frequently:

script returned exit code 255

Am I missing something? Please let me know in case you need further details!

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Saurabh Chauhan
  • 3,161
  • 2
  • 19
  • 46
  • Can you cross check if `"selenium-standalone": "^6.16.0"` is a valid entry? – undetected Selenium Apr 05 '19 at 09:08
  • @DebanjanB: Can you elaborate in detail? I think I am using the latest version of `selenium-standalone` and it is `6.16.0`. Please feel free to correct me. – Saurabh Chauhan Apr 05 '19 at 09:13
  • I don't do [tag:node.js] but haven't known about `"selenium-standalone": "^6.16.0"` while working with _Java_, _Python_ and _C#_ binding art. So I suggested to cross check. – undetected Selenium Apr 05 '19 at 09:16
  • 1
    @DebanjanB: It looks like `selenium-standalone` module is no more needed. I have removed it from the `package.json` and test case worked locally. – Saurabh Chauhan Apr 05 '19 at 09:21

1 Answers1

1

As per the contents of package.json file, the following entry doesn't looks like a valid entry:

"selenium-standalone": "^6.16.0"

Removing this entry will address the errors.


However, it seems you are using chrome=73.0.3686 on Windows 10 Pro 64 bit

John Chen (Owner - chromedriver) recently have confirmed that:

We have confirmed issues with take screenshot when Chrome 73.0.3686.75 is started by a service (such as Jenkins or Task scheduler) on Windows. Please see https://crbug.com/942023 for more details. We apologize for any inconvenience caused by this.

However, we haven't yet been able to observe similar issue on Linux, so we appreciate any help you can provide to enable us to reproduce the issue on Linux. We don't have access to TeamCity, but we have tested take screenshot using Docker image produced by Selenium (selenium/standalone-chrome:3.141.59-lithium), and didn't find any problems.


Solution

The solution would be to:

Note: If you are using Chrome version 72, please download ChromeDriver 2.46 or ChromeDriver 72.0.3626.69

As an alternative , you can add the argument --disable-features=VizDisplayCompositor through an instance of ChromeOptions() seems solves the issue:

ChromeOptions options = new ChromeOptions();
options.addArguments("--disable-features=VizDisplayCompositor");
WebDriver driver = new ChromeDriver(options);
driver.get("https://google.com");

Reference

Here are the reference discussions:


Outro

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • Thank you for the answer. But now I am getting this error on Jenkins `Error: Timed out waiting for the WebDriver server at http://127.0.0.1:51728/ .` Can you please guide me what should I do? – Saurabh Chauhan Apr 05 '19 at 11:14
  • @SaurabhChauhan So, what is your _OS_ variant, **Windows**? – undetected Selenium Apr 05 '19 at 12:57
  • `Chrome Version 73.0.3683.86 (Official Build) (64-Bit)` and `Windows 10 Pro 64 bit`. Please let me know in case you need further details or information, I would be happy to provide you. Thank you – Saurabh Chauhan Apr 05 '19 at 13:04
  • Thank you for your time and effort. I appreciate it. I will get back to you soon. I hope this will help me to solve my problem. – Saurabh Chauhan Apr 05 '19 at 13:15
  • Still I am getting this error on Jenkins `Windows Batch Script script returned exit code 255`. I have downgraded chrome version from 73 to 72 and also added the right chrome driver for it. Can you please guide me? – Saurabh Chauhan Apr 08 '19 at 10:46