如何使用Selenium webdriver在我的桌面上打開本地HTML文件?使用selenium webdriver打開本地HTML文件
我試圖像下面,但無法打開
public static String OpenStub (String stub) {
try {
driver=new FirefoxDriver();
driver.manage().timeouts().pageLoadTimeout(10000, TimeUnit.MILLISECONDS);
driver.get("C://Users//sharmayo//Desktop//testlogin.html");
return "Pass";
}
}
沒有工作得到如下錯誤文件找不到 的Firefox不能找到在/ C文件:/用戶/ sharmayo/workspace/FodB測試/結果/結果_09-08-2015 13-11-19 /截圖/ FDB-1通過Appt browser.png查看Stub。 檢查文件名是否有大寫字母或其他鍵入錯誤。 檢查文件是否被移動,重命名或刪除。 – yogesh
更新了我的答案! ??你有沒有使用testlogin.html的路徑?你的testlogin.html中有什麼可以提供代碼,也許你正在鏈接到一個不存在的資源 - >首先使用testlogin.html中最簡單的html – drkthng