我是Robot框架的新手,我從this鏈接跟隨了所有相關步驟,但是,我收到了一些我無法識別的錯誤。任何人,請幫助。'chromedriver'可執行文件需要位於PATH中。機器人框架pycharm
*** Settings ***
Documentation Simple example using SeleniumLibrary.
Library Selenium2Library
Library OperatingSystem
*** Variables ***
${LOGIN URL} https://www.google.com/
${BROWSER} Chrome
${EXECDIR} C:\chromedriver_win32\chromedriver.exe
*** Test Cases ***
Checking browser to login page
Setup chromedriver
Open Browser To Login Page
*** Keywords ***
Open Browser To Login Page
Open Browser ${LOGIN URL} ${BROWSER}
Setup chromedriver
Set Environment Variable webdriver.chrome.driver ${EXECDIR}
這裏是我得到的錯誤
C:\Users\sanat\AppData\Local\Programs\Python\Python36-32\Scripts\pybot.bat
Smoke.robot
======================================================================
Smoke :: Simple example using SeleniumLibrary.
=====================================================================
Checking browser to login page | FAIL |
WebDriverException: Message: 'chromedriver' executable needs to be in
PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
-------------------------------------------------------------------
Smoke :: Simple example using SeleniumLibrar | FAIL |
1 critical test, 0 passed, 1 failed
1 test total, 0 passed, 1 failed
===============================================================
Output: C:\Users\sanat\PycharmProjects\RobotFram\output.xml
Log: C:\Users\sanat\PycharmProjects\RobotFram\log.html
Report: C:\Users\sanat\PycharmProjects\RobotFram\report.html
C:\Users\sanat\AppData\Local\Programs\Python\Python36-32\lib\runpy.py:125:
RuntimeWarning: 'robot.run' found in sys.modules after import of package
'robot', but prior to execution of 'robot.run'; this may result in
unpredictable behaviour
warn(RuntimeWarning(msg))
Process finished with exit code 1
我ChromeDriverPath是絕對正確的,我現在用的是最新版本的Chrome驅動程序。
在這裏再添加一點:我的Intellibot也給我selenium關鍵字的編譯時錯誤,如'打開瀏覽器',這是我不明白爲什麼? 安裝機器人和pycharm版本:機器人框架3.0.2(在Win32的Python 3.6.3)
請顯示導致此錯誤的小代碼示例。 –
截至目前,我還沒有編寫任何自定義庫或代碼,它們都是庫中預定義的關鍵字。 – Sanat
你是否對chromedriver錯誤做過任何研究?這個網站上有很多相關的問題。您是否訪問了錯誤消息中的URL並閱讀了「入門」文檔? –