다음 오류가 발생합니다.Selenium WebDriver 오류 : java.net.SocketException : 연결 재설정
이 코드를 추가하면 이전에 잘 작동합니다. 나는 아무것도 바꾸지 않았다. 파이어 폭스 브라우저가 열려 있지만 아무 일도 일어나지 않습니다. 오른쪽 아래에 작성된 webdriver를 볼 수 있습니다.
Exception in thread "main" org.openqa.selenium.WebDriverException: java.net.SocketException: Connection reset
Build info: version: '2.4.0', revision: '13337', time: '2011-08-12 09:57:13'
System info: os.name: 'Windows Vista', os.arch: 'x86', os.version: '6.0', java.version: '1.7.0'
Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:404)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:106)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:89)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:127)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:78)
at org.openqa.selenium.example.GetAllOptionInDropdown.main(GetAllOptionInDropdown.java:13)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:130)
at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:127)
at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:233)
at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:98)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:210)
at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:271)
at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:233)
at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:209)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:292)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:126)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:483)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)
at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:274)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:254)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:125)
at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:257)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:387)
... 5 more
코드 던지는 오류 :
package org.openqa.selenium.example;
import java.util.List;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class GetAllOptionInDropdown {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.co.in/advanced_search");
List<WebElement> element = driver.findElements(By.xpath("//div/table[2]/tbody/tr[3]/td/select/option"));
System.out.println("Total DropDown Options "+ element.size());
for (WebElement webElement : element) {
System.out.println(webElement.getText());
}
driver.quit();
}
}
이 예외가 발생하는 코드를 표시하십시오. –
마이크 - 위 코드와 일부 추가 정보가 추가되었습니다. –
아니요, 저에게 잘 돌아갑니다. 47 가지 옵션을 인쇄합니다. –