Getting Timed out receiving message from renderer: 600.000 When we execute selenium scripts using Jenkins windows service mode - selenium

We are executing our selenium automation script using jenkins window service(Headless mode) on daily basis .it was working fine till yesterday. suddenly it stopped working and not launching the browser. it shows the below error message [1553677874.187][SEVERE]: Timed out receiving message from renderer: 600.000. after that all the remaining test cases are getting failed.
It is working fine if we run the build using jenkins as without windows service. We are experiencing this issue only with windows as service
My chrome driver version :73.0.3683.68
Chrome browser version :73.0.3683.68
Selenium Version :3.14.0
I have tried to downgrade the browser version and driver version. even though it is not working
I am expecting the browser should launch in the background when we execute using jenkins as windows service but getting error message.
System.setProperty("webdriver.chrome.driver", "C:\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("load-extension=C:\\1.13.4_0");
options.addArguments("--start-maximized");
options.addArguments("--ignore-certificate-errors");
options.addArguments("--disable-popup-blocking");
// options.addArguments("window-size=1400,600");
options.addArguments("enable-automation");
options.addArguments("--headless");
options.addArguments("--window-size=1920,1080");
options.addArguments("--no-sandbox");
// options.addArguments("--disable-extensions");
options.addArguments("--dns-prefetch-disable");
options.addArguments("--disable-gpu");
options.setPageLoadStrategy(PageLoadStrategy.NORMAL);
DesiredCapabilities capabilities =
DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY,
**strong text**options);
return new ChromeDriver(capabilities);

Seems you are using the following configuration:
chromedriver=73.0.3683.68
chrome=73.0.3683.68
Windows OS
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.
Yesterday (Mar 26, 2019), John once again confirmed:
I am aware of some issues with running Chrome 73 from Jenkins. I don't know any workarounds. Please following https://crbug.com/942023 for updates.
Update
We were able to dig up the main issue. The main issue is not with ChromeDriver v73.x as such but with Chrome v73.x and John officially confirms it as:
The root cause is indeed in Chrome 73.x, not in ChromeDriver. We are working with Chrome devs to find a solution.
Solution
A quick fix solution will be to:
Downgrade Chrome Browser to Chrome v72.x
Use a matching ChromeDriver among:
ChromeDriver 2.46
ChromeDriver 72.0.3626.69
Note: If you are using Chrome version 72, please download ChromeDriver 2.46 or ChromeDriver 72.0.3626.69
Ensure that JDK is upgraded to recent level of JDK 8u202.
Outro
You can find the relevant discussions in:
Page.captureScreenshot no longer works in Chrome 73 under Selenium as a Service on Windows
Error [SEVERE]: Timed out receiving message from renderer: 20.000 while executing the testsuite through Selenium on Jenkins
Download Google Chrome 72 Offline Installer For All Operating Systems
Update(03-April-2019)
Adding 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");

Possible problem is that your Google Chrome updated and became incompatible with your Chromedriver. I suggest either getting a new Chromedriver or downgrading your Google Chrome to a previous version and disabling auto updates.
You can verify the required Chromedriver version for your Google Chrome here:
http://chromedriver.chromium.org/downloads
Step 4 of the following link worked for me to disable automatic google Chrome updates.
https://www.webnots.com/7-ways-to-disable-automatic-chrome-update-in-windows-and-mac/

Add below property(1) before ChromeDriver initialization
System.setProperty("webdriver.chrome.silentOutput", "true");
driver = new ChromeDriver();

Related

How do I get version of Chrome on Selenium Node?

I'm learning how to run tests on SeleniumGRID.
I have problem with specifying the version of Chrome browser.
I have 1 Selenium Hub and 1 Selenium Node connected to the Hub.
Selenium Node has Chrome browser. The version of browser is:
85.0.4183.102
If I use:
DesiredCapabilities capability = new DesiredCapabilities();
capability.setBrowserName("chrome");
capability.setCapability("platform", "Linux");
it will work fine. But if I add:
capability.setCapability("version", "85.0");
I will get error:
org.openqa.selenium.WebDriverException: Error forwarding the new session cannot find : Capabilities {browserName: chrome, platform: LINUX, version: 85.0}
What should I put in version to run it?
I was trying various possibility (85, 85.0, 85.0.4183.102) but neither of them worked.
I think it's because Node probably doesn't have specified the Chrome version.
I ran the Node with configuration in json file. Then I was able to specify the Chrome version in this json file.
And then I was able to run tests with specified chrome version.

Chrome driver has stopped error when running Selenium tests (version 80)

Our chrome instance keeps crashing when running our Selenium tests from a VM that hosts our Jenkins instance and automation containers. It seems to run fine when tried locally (same browser version as the VM). I've been trying to fix this for several weeks now and checked other similar SO posts but to no success so far and am really stuck at this point.
These are the configs we have.
Chrome Driver version 80.0.3987.106
Java version 1.8.0_144
Selenium Chrome driver 3.141.59
Chrome browser 80.0.3987.149
ChromeOptions options = new ChromeOptions();
options.addArguments("start-maximized" );
options.addArguments("disable-infobars" );
options.addArguments("--disable-extensions" );
options.addArguments("--window-size=1200x600" );
options.addArguments("--disable-cache" );
options.addArguments("--disable-application-cache" );
options.addArguments("--disk-cache-size=0" );
options.addArguments("--disable-gpu" ); // applicable to windows os only
options.addArguments("--disable-dev-shm-usage" ); // overcome limited resource problems
options.addArguments("--dns-prefetch-disable" );
options.addArguments("--no-sandbox" ); // Bypass OS security model
options.setPageLoadStrategy(PageLoadStrategy.NORMAL);
driver = new ChromeDriver(options);
Thanks a lot.
Though you mentioned about using Java version 1.8.0_144 but as per your screenshot your effective Java version is 1.8.0_77 which is ancient.
Hence you see the error.
Solution
An effective solution would be to upgrade JDK to current level of JDK 8u241.
Not sure if the ideal solution but in the end that's what fixed the issue for us.
We added a thread in between tests and after the chrome driver closes, so that it would have some buffer time to breath before reloading and since then it's stopped crashing.

chrome driver.manage().window().maximize() exception failed to change window state to maximized [duplicate]

The release notes for ChromeDriver 2.33 says that ""Fixes a bug which caused Resizing/Positioning Window commands to fail on Chrome 62+" however this still seems to be an issue when i am using Chrome 62+ browser. Maximizing chrome window using chrome driver results in below exception. Does anyone know a solution please?
Another thing i noticed is, though i installed latest chromedriver (v2.33) from https://chromedriver.storage.googleapis.com/index.html?path=2.33/, the log printed below says Driver info: chromedriver=2.25.426923 !!
Exception in thread "main" org.openqa.selenium.WebDriverException:
unknown error: cannot get automation extension from unknown error:
page could not be found:
chrome-extension://aapnijgdinlhnhlmodcfapnahmbfebeb/_generated_background_page.html
(Session info: chrome=62.0.3202.62) (Driver info:
chromedriver=2.25.426923
(0390b88869384d6eb0d5d09729679f934aab9eed),platform=Windows NT
10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
There are exactly 2 issues.
As you mentioned, you have installed latest chromedriver (v2.33) but the log printed below says Driver info: chromedriver=2.25.426923, this issue must be addressed first. You can consider to manually kill all the dangling chromedriver.exe tasks from the Task Manager. Additionally you can consider to use CCleaner to wipe out all the rotten OS stuffs from your system. Take a system reboot if required. Finally ensure that what ever the absolute location of chromedriver.exe you are using within System.setProperty() ensure that the chromedriver binary is of version 2.33.
Finally, it is suggested to use ChromeOptions class to maximize the Web Browser as follows:
System.setProperty("webdriver.chrome.driver", "C:\\your_directory\\chromedriver.exe");
ChromeOptions opt = new ChromeOptions();
opt.addArguments("disable-infobars");
opt.addArguments("--start-maximized");
opt.addArguments("--disable-extensions");
WebDriver driver = new ChromeDriver(opt);
driver.get("https://google.com");
Here are some of the alternatives which may solve your question:
Using maximize() from WebDriver.Window interface :
driver.manage().window().maximize();
Using setSize(Dimension targetSize) from WebDriver.Window interface:
driver.manage().window().setSize(new Dimension(800, 600));
Using addArguments("--start-maximized") through ChromeOptions:
chromeOptions.addArguments("--start-maximized");
Using addArguments("--window-size=1920,1080") through ChromeOptions:
chromeOptions.addArguments("--window-size=1920,1080");
Using executeScript() from JavaScriptExecutor interface:
((JavaScriptExecutor)driver).executeScript("window.resizeTo(1024, 768);");
You can find a related discussion in Chrome - org.openqa.selenium.WebDriverException: unknown error: cannot get automation extension at driver.manage().window().maximize();.
I believe there were some old chrome driver processes running in backend and same were being picked up when it was invoked via code. I deleted all processes instances, deleted old version of chrome driver, added the new 2.33 version and it worked. Thanks all for your suggestions.
I think the reason behind it may be your chrome version. Try again with updating your chrome browser. I have faced this type of issues for compatibility between chrome browser & the driver
Use class ChromeOptions.
System.setProperty("webdriver.chrome.driver", "h:\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("disable-infobars");
options.addArguments("--start-maximized");
WebDriver driver = new ChromeDriver(options);
driver.get(url);

geb.driver.DriverCreationException: failed to create driver from callback

I am getting below Exception while running test scripts.
geb.driver.DriverCreationException: failed to create driver from callback 'script1501516684770944233575$_run_closure1#6601cc93'
java.lang.NoClassDefFoundError: Lorg/openqa/selenium/remote/html5/RemoteWebStorage;
failed to create driver from callback 'script1501516684770944233575$_run_closure1#6601cc93'
OS: Windows 10 64 bit
Chrome browser: v60 (latest one)
Selenium :-2.43.1
Chrome web driver:-2.24.417431
geb-version:0.10.0
geb-testng-version:0.13.1
geb-spoc-version:0.13.1
Thanks in Advance...!
This will be a version issue (your old web driver is not compatible with newer chrome versions). If you are using the latest version of chrome, I suggest moving to the latest version of selenium and chrome driver.
Infact one quick google suggests that I might be right: https://sites.google.com/a/chromium.org/chromedriver/downloads
Latest Release: ChromeDriver 2.31
Supports Chrome v58-60
This error can be thrown if you do not correctly define your chrome driver location when executing your tests.
Either in your GebConfig:
driver = {
System.setProperty('webdriver.chrome.driver', '/Users/foo/drivers/chromedriver')
new ChromeDriver()
}
Or in something like VM parameters if running from an intelliJ Run/Debug Configuration:
-Dbrowser=chrome -Dwebdriver.chrome.driver="/Users/foo/drivers/chromedriver/chromedriver.exe"
I was having this problem for a couple of days and finally understand the cause. This problem occurred for me on Jenkins when I am setting my browser to chrome or firefox and then trying to run my tests. It occurred due to browsers not installed on Jenkins machine. The drivers are present in the code but the browser should be installed on machine otherwise Geb will throw this error. Hope this helps.

Firefox 47.0 to crash on startup selenium webdriver

Yesterday we updated Firefox 47.0 and selenium test script started getting crash,
Please see attached screenshot.
Firefox getting crash
as mentioned in Firefox release notes they suggested to use Marionette WebDriver . We have downloaded Marionette WebDriver for windows and as mentioned in link we made code changes by adding Marionette WebDriver in bin/debug folder.Below are code changes for same
var driver = new FirefoxDriver(new FirefoxOptions());
However we are facing issue "entity not found"
Note : We are using c# selenium WebDriver on Windows7 64 bit OS and We tired below solution such as
Renamed Marionette WebDriver to wires.exe
Add Marionette WebDriver exe path in Environment variable.
Use RemoteWebDriver as shown below
DesiredCapabilities capabilities = DesiredCapabilities.Firefox();
// Set Marionette on so the Grid will use this instead of normal FirefoxDriver
capabilities.SetCapability("marionette", true);
var driver = new RemoteWebDriver(capabilities);
Please somebody help in this issue.
Have the same issue, the problem is unclear for now, but this kind of situation was before, you just need to wait new selenium update or Firefox fix (depends who introduced this problem), for now you could revert to previous version of FireFox.
https://support.mozilla.org/en-US/kb/install-older-version-of-firefox
UPD: Now if you using Firefox 47 you need to use new FirefoxDriver(geckodriver),
Details could be found here:
https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver
You need to add wires.exe to your System Path, not bin/debug. The Mozilla marionette instruction page does not mention bin/debug at all. Also make sure the executable is present on the path for the system your grid hub and grid nodes are running on, not just the system where the tests are running.