Finally I got it.web
沒有自動化過edge,今天被小坑了一下,可是還好如今弄好了。code
1. 查看edge 版本,個人是14.14393orm
2. https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ 下載edge driver。必定要下載support version的driver哦,不然你單獨運行webdriver就會提示你這個版本不匹配。blog
C:\Users\***\Downloads>MicrosoftWebDriver.exe
This version of MicrosoftWebDriver.exe is not compatible with the installed version of Windows 10.
For more information, visit http://aka.ms/webdriverselenium
直接跑test報的錯我也貼過來,免的有人跟我同樣,他說檢測assert_process_still_running 有問題,其實仍是driver不匹配~ 你們要注意哦~it
ft1.1: <subprocess.Popen object at 0x03A188F0> <subprocess.Popen object at 0x03A188F0> Traceback (most recent call last): File "C:\Users\***\Desktop\first_webdriver.py", line 15, in setUp self.driver = webdriver.Edge("c:/users/***/downloads/MicrosoftWebDriver.exe") File "C:\Python27\lib\site-packages\selenium\webdriver\edge\webdriver.py", line 34, in __init__ self.edge_service.start() File "C:\Python27\lib\site-packages\selenium\webdriver\common\service.py", line 96, in start self.assert_process_still_running() File "C:\Python27\lib\site-packages\selenium\webdriver\common\service.py", line 110, in assert_process_still_running % (self.path, return_code) WebDriverException: Message: Service c:/users/***/downloads/MicrosoftWebDriver.exe unexpectedly exited. Status code was: 1