"'Service' object has no attribute 'process'"

在安裝完robot framework以後,編寫了打開瀏覽器的用例,可是在打開瀏覽器的步驟一直報錯html

問題緣由是,雖然下載了selenuim,可是並無瀏覽器driver,因此還要單獨下載瀏覽器driver放在path的路徑下(如c:python27,c:python27/scripts),這樣就能夠直接調起來了python

 


 selenium3.0發佈之後,在3.0裏再也不有 Firefox 的驅動了,Mozilla 也把 Firefox 的 driver 獨立發佈出來了,而這個 driver 就是 geckodriver 了web

因此我把selenium升級到3.0,終於把火狐瀏覽器掉起來了,成功~~撒花~~~chrome

selenium升級方法:用cmd的pip命令查看如今能夠升級的包,看到裏面有selenium,而後用pip命令升級瀏覽器


 

具體問題:app

 1 command: pybot.bat --argumentfile c:\users\yangya~1\appdata\local\temp\RIDEvud5bz.d\argfile.txt --listener C:\Python27\lib\site-packages\robotide\contrib\testrunner\TestRunnerAgent.py:60343:False E:\ride項目文件夾\客戶端彈窗.robot
 2 =================================================================================================================
 3 客戶端彈窗                                                                                                       
 4 =================================================================================================================
 5 use_ticket                                                                                               | FAIL |
 6 WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
 7 -----------------------------------------------------------------------------------------------------------------
 8 客戶端彈窗                                                                                               | FAIL |
 9 1 critical test, 0 passed, 1 failed
10 1 test total, 0 passed, 1 failed
11 =================================================================================================================
12 Output:  c:\users\yangya~1\appdata\local\temp\RIDEvud5bz.d\output.xml
13 
14 [ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: No browser is open
15 Log:     c:\users\yangya~1\appdata\local\temp\RIDEvud5bz.d\log.html
16 Report:  c:\users\yangya~1\appdata\local\temp\RIDEvud5bz.d\report.html
17 
18 Exception AttributeError: "'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x0000000003E37668>> ignored
19 
20 test finished 20170315 20:19:56

解決問題1:ide

"'Service' object has no attribute 'process'" in <bound method Service.__del__ of <selenium.webdriver.chrome.service.Service object at 0x0000000003E37668>> ignored

解決辦法:

說明是瀏覽器驅動器沒有安裝,點擊上面的網址安裝谷歌瀏覽器的驅動器,並設置好驅動器的路徑到環境變量PATH中去。
我由於以前設置過Python的環境變量:D:\Python27,因此這裏直接把下載的chromedriver.exe複製到D:\Python27目錄下便可,不用額外再設置了。ui

分享個連接:http://pan.baidu.com/s/1eSabNH4google

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

---恢復內容結束---spa

相關文章
相關標籤/搜索