How to use the html driver | Selenium Forum
M
Posted on 01/06/2016
Hi Ashish / All,

I am opening the Chrome Browser my disabling the Certificates and other Addons since in my Org enabling all this Addons needs more privilate access...

Now the situation I am facing is Chrome browser opens successfully by disabling Cert and addons ...

I have to checkpoint where I do all the http response is 200 for the URL... However I am unable to establish this check point because

its failing with javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException

As I have NOT acceptted the SSL.. while opening the chrome browser...

How to achive this with minimum code with out any further privileges...

below is the sample code

//To check the response of the URL ; 200 - Ok
protected static boolean getResponse(String currentUrl) {
boolean result=false;
try {
URL url = new URL(currentUrl);
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setRequestMethod("GET");
connection.connect();

int code = connection.getResponseCode();

System.out.println("The Response Code is -> "+ code);

if (code == 200)
result = true;

} catch (Exception e) {
e.printStackTrace();
result = false;
}

return result;
}



Thanks in advance.

Regards
J

M
Replied on 01/06/2016

have you used firefox? firefox profile can help with your problem.


M
Replied on 01/06/2016

we are allowed to use only Chrome Responsive image


M
Replied on 02/06/2016

try with desired capabilities.


M
Replied on 02/06/2016

Thanks, i could able to get inside the Page with desired capabilities...But I click any link and check for the response code for 200...

But What i get is

javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1886)


M
Replied on 02/06/2016

i don't know the exact networking conditions

but this might be helpful.


http://stackoverflow.com/questions/10258101/sslhandshakeexception-no-subject-alternative-names-present


M
Replied on 05/06/2016

Hi Ashish,

I think you my question wrong, let me put in detail in different ticket. Appreciate if I can get real solution for that.

Thanks

Regards
J