[Python] Selenium chromium browser sometimes not opens a page

Discussão em 'Python' iniciado por Stack, Abril 22, 2025.

  1. Stack

    Stack Membro Participativo

    I have chromium and chrome-driver installed with necessary requirements in my Dockerfile and am running the automation code inside container, It works for some operations and it would not work for some other operations.

    Right now in my automation I am doing click on button which leads to opening a new page, able to perform click on the button however my Automation is unable to locate anything in the page after that, I tried capturing a screenshot and that also did not work.

    My chromium and chromedriver are of linux based running on linux/amd64 architecture.

    I am using these:-

    [chromium Browser for linux][https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F1129867%2Fchrome-linux.zip?generation=1681401333766259&alt=media]

    [Chromedriver-linux][https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Linux_x64%2F1129867%2Fchromedriver_linux64.zip?generation=1681401337961812&alt=media]

    Error is as follows:- Please note that the xpaths given are correct.

    2025-04-22 13:12:21,792[INFO ] Inside test function-site_creation_current_timestamp
    2025-04-22 13:12:36,809[CRITICAL] Module:site_creation_current_timestamp||method:screenshot::Failed to capture the screenshot
    2025-04-22 13:12:36,811[ERROR ] Message: timeout: Timed out receiving message from renderer: 15.000
    (Session info: headless chrome=114.0.5714.0)
    Stacktrace:
    #0 0x555555ddc7c2 <unknown>
    #1 0x555555dce013 <unknown>
    #2 0x555555ad5ac1 <unknown>
    #3 0x555555abfb69 <unknown>
    #4 0x555555abf8ae <unknown>
    #5 0x555555abe71e <unknown>
    #6 0x555555abed7c <unknown>
    #7 0x555555ad1aee <unknown>
    #8 0x555555ad2782 <unknown>
    #9 0x555555adf488 <unknown>
    #10 0x555555ae381b <unknown>
    #11 0x555555abf1f8 <unknown>
    #12 0x555555adf2c3 <unknown>
    #13 0x555555b4d13b <unknown>
    #14 0x555555b35c83 <unknown>
    #15 0x555555b05482 <unknown>
    #16 0x555555b066bc <unknown>
    #17 0x555555d81a8e <unknown>
    #18 0x555555d9bfaf <unknown>
    #19 0x555555d9ba29 <unknown>
    #20 0x555555d9c4a5 <unknown>
    #21 0x555555da39c3 <unknown>
    #22 0x555555d9c7fb <unknown>
    #23 0x555555d71720 <unknown>
    #24 0x555555db9808 <unknown>
    #25 0x555555db994f <unknown>
    #26 0x555555dc8036 <unknown>
    #27 0x7fffff22f1f5 <unknown>
    #28 0x7fffff2aeb00 __clone
    Traceback (most recent call last):
    File "/app/CSQA/ART/mist/utils/ui_utils/web_runner.py", line 864, in screenshot
    driver.save_screenshot(screenshot_path + function_name + ".png")
    File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 1342, in save_screenshot
    return self.get_screenshot_as_file(filename)
    File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 1317, in get_screenshot_as_file
    png = self.get_screenshot_as_png()
    File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 1353, in get_screenshot_as_png
    return b64decode(self.get_screenshot_as_base64().encode('ascii'))
    File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 1365, in get_screenshot_as_base64
    return self.execute(Command.SCREENSHOT)['value']
    File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 424, in execute
    self.error_handler.check_response(response)
    File "/usr/local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
    selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from renderer: 15.000
    (Session info: headless chrome=114.0.5714.0)
    Stacktrace:

    same as above


    My lib versions selenium==4.1.0 pytest==7.2.0

    I am new to this,So Please do let me know if any other information is required.

    Thanks in Advance.

    Continue reading...

Compartilhe esta Página