如何使用Robotframework为selenium:chromedriver解决SessionNotCreatedException?

时间:2019-09-08 15:03:39

标签: python-2.7 selenium selenium-webdriver selenium-chromedriver robotframework

我最近为我的Robotframework项目升级了硒版本,从那以后,我看到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的外观如何?  enter image description here

发生:问题总是在套件的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  

已安装的库: enter image description here

enter image description here

问题:            请让我知道如何解决此问题?

0 个答案:

没有答案