automationg登錄頁面我試圖登錄自動到Facebook。我試圖將硒連接到鉻驅動程序和IE驅動程序。但是當我執行代碼時,我得到一個沒有發現com.google.common.base.Function異常的類。我試圖谷歌它並下載com.google的jar文件並將其添加到eclipse。但是,然後我得到這條線上的IllegalStatementExceptionClassNotFoundException的同時使用硒
WebDriver wd=new InternetExplorerDriver();
這是代碼。
package com.automate;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
public class ConnectToUrl {
public static void main(String agrs[]){
WebDriver wd=new InternetExplorerDriver();
wd.get("https://accounts.google.com/ServiceLogin");
wd.findElement(By.id("email")).sendKeys("Email");
wd.findElement(By.id("pass")).sendKeys("password");
wd.findElement(By.id("u_0_l")).click();
}
}
什麼是錯誤以及如何解決它。
您需要下載最新的iedriverserver.exe並啓動'InternetExplorerDriver(之前設置爲系統屬性IEdriverserver.exe從系統位置路徑可執行文件)' –
在哪裏我可以找到這個IEdriverserver.exe? –
轉到[此URL](http://www.seleniumhq.org/download/)並下載最新版本。 IEdriverServer這是適合你的操作系統... :) –