首页 文章

javax.net.ssl.SSLException:收到致命警报:与Selenium的protocol_version

提问于
浏览
0

运行selenium脚本时收到此错误

org.openqa.selenium.WebDriverException:javax.net.ssl.SSLException:收到致命警报:protocol_version

堆栈跟踪如下:

驱动程序信息:driver.version:sun.security.ssl.Alerts.getSSLException(Alerts.java:208)中的HtmlUnitDriver,位于sun.security.ssl的sun.security.ssl.Alerts.getSSLException(Alerts.java:154) . SSLSocketImpl.recvAlert(SSLSocketImpl.java:1979)at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1086)at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1332)at sun.security.ssl .SSLSocketImpl.startHandshake(SSLSocketImpl.java:1359)位于org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)的sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343) org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)位于org.apache.http.impl.conn的com.gargoylesoftware.htmlunit.httpclient.HtmlUnitSSLConnectionSocketFactory.connectSocket(HtmlUnitSSLConnectionSocketFactory.java:189) . DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator .java:134)org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)atg.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)at org . apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)位于org.apache.http.impl.execchain的org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) . 在org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)的org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:)中的RetryExec.execute(RetryExec.java:88): 184)atg.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:71)at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:179)at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection (WebClient.java:1321)位于com.gargoylesoftware.htmlu的com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1238)来自org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:541)的com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:415)中的nit.WebClient.getPage(WebClient.java:346) .openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:530)at com.mimos.performance.PerfTest.PerfTest(PerfTest.java:34)

构建信息:版本:'2.48.2',修订版:'41bccdd10cf2c0560f637404c2d96164b67d9d67',时间:'2015-10-09 13:08:06'

java版“1.7.0_79”Java(TM)SE运行时环境(版本1.7.0_79-b15)Java HotSpot(TM)64位服务器VM(版本24.79-b02,混合模式)

HtmlUnitDriver driver = new HtmlUnitDriver();        
    driver.get(url);
    WebElement passwordLogo = driver.findElement(By.xpath("/html/body/div[1]/div/div[2]/div/ul/li/a"));
    passwordLogo.click();
    WebElement userID = driver.findElement(By.xpath("/html/body/div/form[1]/input[1]"));
    userID.sendKeys(username);
    WebElement next = driver.findElement(By.xpath("/html/body/div/form[1]/input[2]"));
    next.click();
    WebElement password =  driver.findElement(By.xpath("/html/body/div/form[1]/div/input[1]"));
    password.sendKeys(password);
    WebElement login = driver.findElement(By.xpath("/html/body/div/form[1]/div/input[3]"));
    login.click();
    System.out.println(driver.getTitle());

1 回答

相关问题