python + selenium: save_screenshot/get_screenshot_as_png crashes

184 views
Skip to first unread message

HongX Shi

unread,
Mar 4, 2021, 3:10:39 AM3/4/21
to Selenium Users
Hi Guys

with latest several weeks, whenever we run above functions in Chrome testing, it would get crashed periodically, and once it happens
- it tries to open more chrome browsers till out-of-memory
- it will go very slow for case play
- no snapshots for sure
notes:
1) it works well before
2) it only fail within chrome, not within Edge or Firefox
here is typical exception
Message: timeout: Timed out receiving message from renderer: 10.000
  (Session info: chrome=88.0.4324.190)

any solutions for this case?
thanks
-Hong

HongX Shi

unread,
Mar 4, 2021, 10:21:07 AM3/4/21
to Selenium Users
here is the exception in details:
  File "C:\Test\Hana\lib\fun_sa_db.py", line 226, in sa_insert_pure_snapshot
    snapshot = const.driver.get_screenshot_as_png()
  File "C:\Apps\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 1064, in get_screenshot_as_png
    return base64.b64decode(self.get_screenshot_as_base64().encode('ascii'))
  File "C:\Apps\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 1074, in get_screenshot_as_base64
    return self.execute(Command.SCREENSHOT)['value']
  File "C:\Apps\Python\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
    self.error_handler.check_response(response)
  File "C:\Apps\Python\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from renderer: 10.000
  (Session info: chrome=88.0.4324.190)

Reply all
Reply to author
Forward
0 new messages