0

Receive this error running selenium script

org.openqa.selenium.WebDriverException: javax.net.ssl.SSLException: Received fatal alert: protocol_version

Stack trace below:

Driver info: driver.version: HtmlUnitDriver at sun.security.ssl.Alerts.getSSLException(Alerts.java:208) at sun.security.ssl.Alerts.getSSLException(Alerts.java:154) at sun.security.ssl.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) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1343) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394) at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353) at com.gargoylesoftware.htmlunit.httpclient.HtmlUnitSSLConnectionSocketFactory.connectSocket(HtmlUnitSSLConnectionSocketFactory.java:189) at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134) at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353) at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184) at org.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) at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1238) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:346) at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:415) at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:541) at org.openqa.selenium.htmlunit.HtmlUnitDriver.get(HtmlUnitDriver.java:530) at com.mimos.performance.PerfTest.PerfTest(PerfTest.java:34)

Build info: version: '2.48.2', revision: '41bccdd10cf2c0560f637404c2d96164b67d9d67', time: '2015-10-09 13:08:06'

java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)

    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 Answer 1

0

Good morning. Possibly related to javax.net.ssl.SSLException: Received fatal alert: protocol_version

This seems like a protocol version mismatch, this exception normally happens when there is a mismatch between SSL protocol version used by the client and the server. your clients should use a proctocol version supported by the server.

Sign up to request clarification or add additional context in comments.

1 Comment

No sure how or why, manage to overcome the issue by upgrading my jdk to 8

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.