天天看點

chromedriver(chromedriverexe)

請問如何調用chromedriver.

chrome浏覽器win8.1無法啟動解決方法如下:

1、切換到桌面,在螢幕左下角的win徽标處右擊滑鼠,選擇“運作”。

2、在運作視窗中輸入regedit,回車,打開系統資料庫編輯器。

3、在系統資料庫中的 hkey_classes_root 根鍵下找到類似 chromehtml.duxgjlxibais6fu2re3blu4ajq(前面的chromehtml相同,後面的一大串字母和數字可能每個人不一樣)的子鍵。

4、展開 chromehtml.duxgjlxibais6fu2re3blu4ajq 子鍵,找到 shell\open\command 這個節點,點選 command。

5、在右邊的 delegateexecute 一項上右擊滑鼠,選擇“删除”,然後關閉系統資料庫視窗。

怎麼将chromedriver.exe位置到path環境變量實作

在gem 安裝完watir-webdriver後,預設情況下chrome浏覽器的支援是沒有安裝上的。是以如果要使用webdriver測試chrome的話,我們需要手動安裝chrome支援。

RequirementsThe ChromeDriver controls the browser using Chrome's automation proxy framework. Consequently, the ChromeDriver is only compatible with Chrome version 12.0.712.0 or newer.

從官方文檔上可以看出,chrome driver隻支援chrome12.0712以上的版本。

萬事俱備後,首先下載下傳chrome driver将下載下傳好的chromedriver.exe放在環境變量所配置的檔案夾中。

使用下面的代碼測試chrome driver是否安裝完成:

#使用watir-webdriver文法