テストの自動化にSeleniumを使用しています。私のアプリケーションはIEのみを使用しており、他のブラウザでは動作しません。
コード:
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public class Test {
public static void main(String[] args) {
final String sUrl = "http://www.google.co.in/";
System.setProperty("webdriver.chrome.driver","C:\\Users\\vthaduri\\workspace\\LDCSuite\\IEDriverServer.exe");
WebDriver oWebDriver = new InternetExplorerDriver();
oWebDriver.get(sUrl);
WebElement oSearchInputElem = oWebDriver.findElement(By.name("q")); // Use name locator to identify the search input field.
oSearchInputElem.sendKeys("Selenium 2");
WebElement oGoogleSearchBtn = oWebDriver.findElement(By.xpath("//input[@name='btnG']"));
oGoogleSearchBtn.click();
try {
Thread.sleep(5000);
} catch(InterruptedException ex) {
System.out.println(ex.getMessage());
}
oWebDriver.close();
}
}
そして、これが私が得ているエラーです
ドライバー実行可能ファイルへのパスは、webdriver.ie.driverシステムプロパティで設定する必要があります。詳細については、https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriverを参照してください。最新バージョンは、 http://www.seleniumhq.org/download/からダウンロードできます。 2012年6月12日16:18:42 org.apache.http.impl.client.DefaultRequestDirector tryExecute INFO:I / O例外(java。 net.SocketException)リクエストの処理中にキャッチ:ソフトウェアが接続の中止を引き起こしました:recvが失敗しました2012年6月12日16:18:42 org.apache.http.impl.client.DefaultRequestDirector tryExecute
誰かがこれについて私を助けることができますか?