简体   繁体   中英

How to fix the error: screenshot failed, retrying timeout: Timed out receiving message from renderer: 10 using Selenium

First of all, I want to say that I already read / applied all fixes listed on StackOverflow related to the same question and they do not work in my case, that's why I opened up a new one.

I am using selenium grid (4.0) with a chrome node (docker containers)

I am doing some screen captures on some sites, and running everything using Behat

Everything is fine, until I get to one page that is really big in height, and I want to capture the mobile version of it (which ends up being 120.000px in height)

That's when I see the following error in logs:

capture-service-chrome | [1648642983.839][SEVERE]: Timed out receiving message from renderer: 10.000
capture-service-chrome | [1648642983.843][WARNING]: screenshot failed, retrying timeout: Timed out receiving message from renderer: 10.000

I've already added everything I possible could in my Behat file

            idleTimeout: 20000
            pageLoadStrategy: none
            timeouts: {implicit: 20000, pageLoad: 20000, script: 20000}
            chromeOptions:
              args:
                - "--no-sandbox"
                - "--headless"
                - "--disable-gpu"
                - "--disable-dev-shm-usage"
                - "--no-proxy-server"
                - "--disable-extensions"
                - "--dns-prefetch-disable"
                - "--force-device-scale-factor=1"
                - "--disable-infobars"
                - "--disable-browser-side-navigation"
                - "--disable-setuid-sandbox"
                - "--window-size=1920,1080"
                - "--log-level=3"
                - "enable-features=NetworkServiceInProcess"
                - "disable-features=NetworkService"

The versions that I am using are: browserVersion: 93.0.4577.82, chrome: {chromedriverVersion: 93.0.4577.82)

I really dont see what else I can do. The same page is captured properly on desktop (eg bigger width, smaller height), but when I try to capture using mobile resolution (320xHEIGHT).. it crashes

I know the problem comes from the height, resizing the browser takes some time or something, but is there a way to fix it?

PS: something weird that I've noticed, is that if I try to capture a page that is 1400x10.000 lets say, and I force it to 1400x120.000, it captures it (adding blank space at the bottom of course), but I get an image with 120k px in height at least... so what's wrong when capturing a smaller width?

This error message...

capture-service-chrome | [1648642983.839][SEVERE]: Timed out receiving message from renderer: 10.000
capture-service-chrome | [1648642983.843][WARNING]: screenshot failed, retrying timeout: Timed out receiving message from renderer: 10.000

...implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context ie


Reason

Though you are using Selenium v4.0 but

  • ChromeDriver version is 93.0.4577.82
  • Google-chrome version is 93.0.4577.82

which are very old and ancient with respect to the current Selenium version of 4.0


Solution

Ensure that:


References

You can find a couple of relevant detailed discussions in:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM