首页 > 解决方案 > 如何使用 Robotframework 解决 selenium:chromedriver 的 SessionNotCreatedException?

问题描述

我最近为我的 Robotframework 项目升级了 selenium 版本,自从我看到 chrome 驱动程序尝试打开 chrome 浏览器但未能以错误开头

SessionNotCreatedException: Message: session not created
from timeout: Timed out receiving message from renderer: 600.000
  (Session info: chrome=76.0.3809.132)

系统详情:Chrome浏览器版本:76.0.3809.132 Windows 10机器chromedriver位置:C:\Python27

发生错误时 chrome 的外观如何? 在此处输入图像描述

发生:问题总是发生在套件中的 4 个测试用例中的 1 个。chrome 浏览器打开 600 秒后关闭。看起来屏幕正在尝试初始化浏览器。

Troubleshoot :
           1. Tried downloading the latest chrome driver 76.0.3809.132
           2. Tried cleaning the project and rerun
           3. Restarted the system
           4. Tried creating a fresh project.
           5. Tried running using from eclipse, pybot,  robot
           6. Updated all the libraries found in pip freeze.   Python 2.7.9 version used
           7. Was it working with previous version of Selenium and chrome driver 76.0.3809.132 with chrome browser 76.0.3809.132? BIG YES, but now I don't know what version I was using.
           8. Tried using selenium grid docker container and the script ran successfully.

使用的代码:

*** Settings ***

Library    SeleniumLibrary 
*** Keywords ***

Open Browser local
    [Arguments]    ${URL}  
    Open Browser    ${URL}    ${BROWSER}

*** Test Cases ***

TC1
   [Setup]  Open Browser local    ${URL}
    #Maximize Browser Window
    Set Browser Implicit Wait    10s  
    Input Text    id=loginid    xxx
    Click Button    id=continue-button    
    Input Text    id=login-password    xxx

    Click Button    id=login-button    
    Sleep    10s  
    [Teardown]   Close Browser  

安装的库: 在此处输入图像描述

在此处输入图像描述

问题:请告诉我如何解决这个问题?

标签: python-2.7seleniumselenium-webdriverselenium-chromedriverrobotframework

解决方案


推荐阅读