SSL certificate error handling in Selenium WebDriver for Chrome,IE and Firefox Browser

firefox-certificate-errorSome time we get these SSL certificate errors or notification in Selenium WebDriver when we try to execute our scripts, but Selenium WebDriver has provided us to give capabilities to handle this certificate error in Chrome Driver/Firefox /IE browsers.

Here I am posting the code that would help you in resolving the SSL error mainly in Chrome Browser

DesiredCapabilities capability = DesiredCapabilities.chrome();
capability.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
driver = new ChromeDriver(capability);

 

Above script will help you in accepting all the SSL certificate in Chrome and by doing so you would not get any SSL error while executing your code.
While in Firefox following code will work.

[the_ad_placement id=”incontent”]

In Firefox you need to apply this code

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
public class acceptSSLCerti { public static void main(String[] args) {
 //Class ProfilesIni details
 ProfilesIni allProfiles = new ProfilesIni();
 // Use FirefoxProfile Constructor
 FirefoxProfile myProfile = allProfiles.getProfile("CertificateIssue");
myProfile.setAcceptUntrustedCertificates(true);
myProfile.setAssumeUntrustedCertificateIssuer(false);
 WebDriver Driver = new FirefoxDriver(myProfile);
Driver.get("WebSite URL were you are facing this Certificate error");
}
}

 

For IE browser we can use following code, But in IE we have two way to handle this problem..
[the_ad_placement id=”incontent”]
Case 1:  In this we will click on “Continue to this website (not recommended)” and for the same we are going to use document.elementById(“Id”)

So let’s see the code

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.testng.annotations.Test;
public class HandlingSSLErrorInIE{
private WebDriver driver;
@Test
public void TestSSLerror() {
//Download IEDriver exe and past in project
System.setProperty("webdriver.ie.driver","IEDriverServer.exe");
driver = new InternetExplorerDriver();
//Open WebSite for time being let's take http://xyz.com
driver.get("https://xyz.com");
//now we are going to use javascipt ,This will click on "Continue to this website (not recommended)" text and will //push us to the page
driver.navigate().to("javascript:document.getElementById('overridelink').click()");
}

 

Case 2: Second method is pretty similar to Chrome SSL Handling code

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
System.setProperty("webdriver.ie.driver","IEDriverServer.exe");
WebDriver driver = new InternetExplorerDriver(capabilities);

 

So by following all the above code snippet we can handle SSL Certificate Error in all major browser like IE, Firefox and Chrome browser.

If you like this post then please like and share this post!!

[the_ad_placement id=”incontent”]

Dwarika Dhish Mishra

My name is Dwarika Dhish Mishra, its just my name and I am trying to bring the worth of my name in to actions and wants to be the solution not the problem. I believe in spreading knowledge and happiness. More over I am fun loving person and like travelling a lot. By nature I am a tester and a solution maker. I believe in the tag line of http://ted.org “Idea worth spreading” . For the same, I have created this blog to bring more and more learning to tester fraternity through day to day learning in professional and personal life. All contents are the part of my learning and so are available for all..So please spread the contents as much as you can at your end so that it could reach to every needful people in testing fraternity. I am pretty happy that more and more people are showing interest to become the part your Abode QA blog and I think this is good sign for us all because more and more content would be before you to read and to cherish. You may write or call me at my Email id: dwarika1987@gmail.com Cell: 9999978609

You may also like...

37 Responses

  1. Gourishankar says:

    how to work with IEBroser with Webdriver, am able to open the required page but not able to do the actions, pls let me know the solution, am in urgency pls dir

    • use the code of Chrome, but in place of Chrome use IE

      or use directly this code

      DesiredCapabilities capabilities = new DesiredCapabilities();
      capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
      _driver = new InternetExplorerDriver(capabilities);

  2. Mohan Panigrahi says:

    Dear Dwarika,
    I tried “CapabilityType.ACCEPT_SSL_CERTS, true” for IE but it fails. Have you tested this ? Although I found another way
    driver.navigate().to(“javascript:document.getElementById(‘overridelink’).click()”);

  3. Mohan Panigrahi says:

    Yes, I’ve included and I tested on IE 10. Here is complete program. Chrome and FF works good with its own approach but not IE.

    public class Certificate {

    private static WebDriver driver = null;

    public static void main(String[] args) {

    //ffDriver();
    //chromeDriver();
    ieDriver();
    }

    private static void ffDriver() {

    ProfilesIni allProfiles = new ProfilesIni();
    FirefoxProfile Profile = allProfiles.getProfile(“default”);
    Profile.setAcceptUntrustedCertificates(true);
    Profile.setAssumeUntrustedCertificateIssuer(false);

    driver = new FirefoxDriver();
    driver.get(“https://182.72.191.163/CCMLoadBalance/login.aspx”);

    }

    private static void chromeDriver() {
    DesiredCapabilities capability = DesiredCapabilities.chrome();
    capability.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);

    System.setProperty(“webdriver.chrome.driver”,”E:\Selenium\chromedriver.exe”);
    driver = new ChromeDriver(capability);
    driver.get(“https://182.72.191.163/CCMLoadBalance/login.aspx”);
    }

    private static void ieDriver() {

    //Add this desiredcapabilities when the security level of IE not set to same.
    DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
    caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
    caps.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);

    System.setProperty(“webdriver.ie.driver”,”E:\Selenium\IEDriverServer.exe”);
    driver = new InternetExplorerDriver(caps);
    driver.get(“https://182.72.191.163/CCMLoadBalance/login.aspx”);
    //driver.navigate().to(“javascript:document.getElementById(‘overridelink’).click()”);
    }

    }

    • caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true)

      So please keep this line of code away from the capability insertion in IE initialization.
      To work with IE problem go manually to the security and set the Protected mode and then run the code that you have written for the SSL by removing the above line for protected mode.

      Try again and this time it will work.

  4. Mohan Panigrahi says:

    I tried all you said suggestions before earlier post, but No luck! How ever as I mentioned earlier I found a completely different way to deal with IE 10. Might be capability works for IE 9 only and not 10!

    driver.navigate().to(“javascript:document.getElementById(‘overridelink’).click()”);

    This works fine but I was not happy with this work around jugad! So I was trying in your way of approach through capability. Appreciate your interest in discussion.

  5. Gee says:

    What’s the license for posts on this blog? Saw something identical: http://selenium-breakthrough.blogspot.com/2013/05/accepting-untrusted-ssl-certificate-in.html

    • I am thankful to Shama..for spreading this post to more and more people..Any study material should not be bounded to license this is my perception..

      I will request to more and more people from testing fraternity to spread posts..

  6. Swatik Panda says:

    Even I am facing the same problem with IE 10 like Mohan. I tried all the workarounds but doesnt work so even i tried with driver.navigate().to(“javascript:document.getElementById(‘overridelink’).click()”);
    But wth no luck. Hoping for some suggestion or else i have try out for some older IE versions.

    Thanks,
    Swatik

  7. Razen says:

    Hi,
    Thanks for the useful tips in Selenium.

    I’m facing an issue while running Test scripts in Firefox Browser inside the proxy network.
    Though I have enabled ‘No Proxy’ or ‘Manual Proxy’ from Network Settings but whenever the script invokes Firefox instance, the proxy settings gets changed to ‘Use System Proxy Settings’.

    I want to set the desired proxy from the scripts itself.

    I tried the following code from – http://docs.seleniumhq.org/docs/04_webdriver_advanced.jsp
    String PROXY = “localhost:8080”;

    org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
    proxy.setHttpProxy(PROXY)
    .setFtpProxy(PROXY)
    .setSslProxy(PROXY);
    DesiredCapabilities cap = new DesiredCapabilities();
    cap.setCapability(CapabilityType.PROXY, proxy);
    WebDriver driver = new FirefoxDriver(cap);

    and from : http://stackoverflow.com/questions/14235802/how-to-set-auto-detect-proxy-settings-in-webdriver-selenium-java
    import org.openqa.selenium.Proxy.ProxyType;`

    public static WebDriver dr = null;
    org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy();
    proxy.setSslProxy(“proxyurl”+”:”+8080);
    proxy.setFtpProxy(“proxy url”+”:”+8080);
    proxy.setSocksUsername(“SSSLL277”);
    proxy.setSocksPassword(“password”);

    DesiredCapabilities dc = DesiredCapabilities.firefox();
    dc.setCapability(CapabilityType.PROXY, proxy);
    dr = new FirefoxDriver(dc);

    In first code the setHttpProxy method itself is not recognized; same happened with setSslProxy from second code.

    I’m missing any jar or imports?

    Thanks,
    Razen

    • Could you please explain the real context what you really want to achieve, might be you need something different than this solution. So first let us discuss this then will make solution on this problem.

    • ProxyServer server = new ProxyServer(8105);
      server.start();
      server.setCaptureHeaders(true);

      server.setCaptureContent(true);
      server.newHar(“test”);
      DesiredCapabilities capabilities = new DesiredCapabilities();
      Proxy proxy = server.seleniumProxy();
      FirefoxProfile profile = new FirefoxProfile();
      profile.setAcceptUntrustedCertificates(true);
      profile.setAssumeUntrustedCertificateIssuer(true);
      profile.setPreference(“network.proxy.http”, “localhost”);
      profile.setPreference(“network.proxy.http_port”, 8105);
      profile.setPreference(“network.proxy.ssl”, “localhost”);
      profile.setPreference(“network.proxy.ssl_port”, 8105);
      profile.setPreference(“network.proxy.type”, 1);
      profile.setPreference(“network.proxy.no_proxies_on”, “”);
      profile.setProxyPreferences(proxy);
      capabilities.setCapability(FirefoxDriver.PROFILE,profile);
      capabilities.setCapability(CapabilityType.PROXY, proxy);
      WebDriver driver = new FirefoxDriver(capabilities);
      driver.get(“http://www.google.com”);
      Har har1 = server.getHar();

      Hope this code would help you

  8. Inonge Chong says:

    Hi,
    I have certificate problems with firefox (as per your screen-grab). I am new to selenium and creating automated tools, what file extension do I use for your script.

  9. Sasidhar Sekar says:

    Thanks Dwarika. Works perfectly for me!

  10. I am trying following code:

    public class FirefoxSSLCertificate {
    public static void main(String[] args) {
    ProfilesIni allProfiles = new ProfilesIni();
    FirefoxProfile myProfile = allProfiles.getProfile(“CertificateIssue”);
    myProfile.setAcceptUntrustedCertificates(true);
    myProfile.setAssumeUntrustedCertificateIssuer(false);
    WebDriver driver = new FirefoxDriver(myProfile);
    driver.get(“https://mail.google.com”);
    }
    }

    Getting following error, not sure, what is being missing?

    Exception in thread “main” java.lang.NullPointerException
    at com.webdriver.tutorial.FirefoxSSLCertificate.main(FirefoxSSLCertificate.java:12)

    Please look into it and let me know.

    • I am suspecting that there is no profile by the name of “CertificateIssue” that’s why getting an NPE, either we can try “default” or add a firefox profile by the name “CertificateIssue”, is this correct?

  11. Niyati says:

    @Dwarika Dhish
    SSL code gives me a NullPointerException ….! Y so .. 🙁

  12. Punit says:

    hey DD, its punit from bangalore. Hey m learning selenium. I tried to run my first program on IE. IE browser is opening but backend m getting error mentioned below :-
    Exception in thread “main” java.lang.NullPointerException
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:600)

    Tell me the solution ASAP.

    Punit

  13. Sushil Kumar says:

    i will trying to following code to handle ssl certificate issue in ie 11 version but it is not work pls give solution.

    DesiredCapabilities capabilites=DesiredCapabilities.internetExplorer();
    capabilites.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS,true);
    capabilites.setCapability(CapabilityType.ACCEPT_SSL_CERTS,true);
    capabilites.setJavascriptEnabled(true);
    System.setProperty(“webdriver.ie.driver”,”C:\\Users\\sushil\\Desktop\\IE\\New folder\\IEDriverServer.exe”);
    WebDriver driver=new InternetExplorerDriver();
    driver.get(“https://ess5-white.echo360.com:8443/ess”);
    driver.navigate().to(“javascript:document.getElementById(‘overridelink’).click()”) ;

  14. Jasper says:

    I’m new to Selenium and Eclipse so please be gentle to me. I have the following code and i want to add the lines of code you suggested but where?

    package com.example.tests;

    import com.thoughtworks.selenium.*;
    import org.junit.After;
    import org.junit.Before;
    import org.junit.Test;
    import static org.junit.Assert.*;
    import java.util.regex.Pattern;

    public class NewArticle2 {
    private Selenium selenium;

    @Before
    public void setUp() throws Exception {
    selenium = new DefaultSelenium(“localhost”, 4444, “*chrome”, “https://www.xxxxxx.nl”);
    selenium.start();

    }

    @Test
    public void testNewArticle2() throws Exception {
    selenium.open(“/Products/”);
    selenium.click(“id=newarticle”);
    selenium.waitForPageToLoad(“30000”);
    selenium.type(“//input[@id=’SupplierProductNumber’]”, “Ab1234”);
    selenium.type(“//input[@id=’TypeName’]”, “AB1234”);
    selenium.type(“//input[@id=’Color’]”, “Zwart”);
    selenium.type(“id=NewEanCode”, “6666666666666”);
    selenium.click(“link=Opslaan”);
    selenium.waitForPageToLoad(“30000”);
    }

    @After
    public void tearDown() throws Exception {
    selenium.stop();
    }
    }

  15. Sandeep says:

    Hi Dwarika Dhish Mishra, I am using FF47, selenium 2.52.0 jar file using marionette webdriver. I manually installed the the certs for “https://cacert.org” but it doesn’t recognise it when I run selenium script.

    script :

    URL server = new URL(“http://localhost:4444/wd/hub”);
    DesiredCapabilities capabilities = DesiredCapabilities.firefox();
    capabilities.setCapability(“marionette”, true);
    capabilities.setCapability(“acceptSslCerts”, true);
    capabilities.setPlatform(Platform.VISTA);

    driver = new RemoteWebDriver(server, capabilities);
    driver.get(“https://cacert.org”);
    Thread.sleep(5000);
    driver.quit();
    driver.close();

    Error:

    Exception in thread “main” org.openqa.selenium.WebDriverException: Error loading page (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 487 milliseconds
    Build info: version: ‘2.52.0’, revision: ‘4c2593c’, time: ‘2016-02-11 19:06:42’
    System info: host: ‘JAINS13-L3’, ip: ‘10.121.65.215’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_92’
    Driver info: org.openqa.selenium.firefox.MarionetteDriver
    Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, appBuildId=20160604131506, version=47.0, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, browserVersion=47.0, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=Firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=Windows_NT, device=desktop}]
    Session ID: a725b860-8eac-460e-b027-56aadf9ef3c6
    Command duration or timeout: 1.16 seconds
    Build info: version: ‘2.53.0’, revision: ’35ae25b1534ae328c771e0856c93e187490ca824′, time: ‘2016-03-15 10:43:46’
    System info: host: ‘JAINS13-L3’, ip: ‘10.121.65.215’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_92’
    Driver info: org.openqa.selenium.remote.RemoteWebDriver
    Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, appBuildId=20160604131506, version=47.0, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, webdriver.remote.sessionid=317084d8-8a16-4cf2-ae0b-183fecf752ba, browserVersion=47.0, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=Firefox, takesScreenshot=true, takesElementScreenshot=true, javascriptEnabled=true, platformName=Windows_NT, device=desktop, cssSelectorsEnabled=true}]
    Session ID: 317084d8-8a16-4cf2-ae0b-183fecf752ba
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
    at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:316)
    at demo.main(demo.java:59)
    Caused by: org.openqa.selenium.remote.ScreenshotException: Screen shot has been taken
    Build info: version: ‘2.53.0’, revision: ’35ae25b1534ae328c771e0856c93e187490ca824′, time: ‘2016-03-15 10:43:46’
    System info: host: ‘JAINS13-L3’, ip: ‘10.121.65.215’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_92’
    Driver info: driver.version: RemoteWebDriver
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:138)
    … 3 more
    Caused by: org.openqa.selenium.WebDriverException: Error loading page (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 487 milliseconds
    Build info: version: ‘2.52.0’, revision: ‘4c2593c’, time: ‘2016-02-11 19:06:42’
    System info: host: ‘JAINS13-L3’, ip: ‘10.121.65.215’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_92’
    Driver info: org.openqa.selenium.firefox.MarionetteDriver
    Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, appBuildId=20160604131506, version=47.0, platform=XP, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, browserVersion=47.0, platformVersion=6.1, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=Firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=Windows_NT, device=desktop}]
    Session ID: a725b860-8eac-460e-b027-56aadf9ef3c6
    Build info: version: ‘2.53.0’, revision: ’35ae25b1534ae328c771e0856c93e187490ca824′, time: ‘2016-03-15 10:43:46’
    System info: host: ‘JAINS13-L3’, ip: ‘10.121.65.215’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_92’
    Driver info: driver.version: EventFiringWebDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
    at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:316)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:103)
    at com.sun.proxy.$Proxy1.get(Unknown Source)
    at org.openqa.selenium.support.events.EventFiringWebDriver.get(EventFiringWebDriver.java:163)
    at org.openqa.selenium.remote.server.handler.ChangeUrl.call(ChangeUrl.java:40)
    at org.openqa.selenium.remote.server.handler.ChangeUrl.call(ChangeUrl.java:1)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

  16. Deepak says:

    Thanks

    but my issue is not resolved yet

    WebDriver driver = null;
    ProfilesIni allProfiles = new ProfilesIni();
    FirefoxProfile Profile = allProfiles.getProfile(“default”);
    Profile.setAcceptUntrustedCertificates(true);
    Profile.setAssumeUntrustedCertificateIssuer(false);

    driver = new FirefoxDriver(Profile);
    driver.get(“https://github.com/SeleniumHQ/selenium-google-code-issue-archive/issues/6404”);
    URL u = new URL(“https://github.com/SeleniumHQ/selenium-google-code-issue-archive/issues/6404”);
    HttpURLConnection h = (HttpURLConnection) u.openConnection();
    h.setRequestMethod(“GET”);
    h.connect();
    System.out.println(h.getResponseCode());
    if (h.getResponseCode() != 200) {
    Assert.fail(“Redirected URL is not right “);
    }

    //getting error at h.connect()
    javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    java.lang.reflect.UndeclaredThrowableException

  17. Madhuri Lashkari says:

    I am also new to selenium and trying to handle SSL on Firefox.Written following code

    ProfilesIni allProfiles = new ProfilesIni();
    FirefoxProfile Profile = allProfiles.getProfile(“default”);
    Profile.setAcceptUntrustedCertificates(true);
    Profile.setAssumeUntrustedCertificateIssuer(false);

    System.setProperty(“webdriver.gecko.driver”, “C:\\Users\\madhuri.l\\Downloads\\geckodriver-v0.11.1-win64\\geckodriver.exe”);
    WebDriver driver = new FirefoxDriver(Profile);

    Getting following error:
    java.lang.NullPointerException
    at stepdefinations.StepDefinations.user_is_on_appsone_site(StepDefinations.java:33)
    at ✽.Given :User is on appsone site(C:/Users/madhuri.l/IdeaProjects/UI-Automation/src/test/java/features/UILoginfeature.feature:3)

  18. Dharmateja says:

    If you are the admin of the execution machine, add the import the SSL certificate to “Trusted Root Certification Authorities”, Under certification folder of Internet Explorer.

  19. Lalaso says:

    Started InternetExplorerDriver server (64-bit)
    3.4.0.0
    Listening on port 39422
    Only local connections are allowed
    Exception in thread “main” org.openqa.selenium.NoSuchSessionException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (WARNING: The server did not provide any stacktrace information)
    Command duration or timeout: 40 milliseconds
    Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
    System info: host: ‘WKSPU00531’, ip: ‘10.192.4.21’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_121’
    Driver info: driver.version: InternetExplorerDriver
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:215)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:167)
    at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
    at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
    at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$22(ProtocolHandshake.java:365)
    at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source)
    at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source)
    at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source)
    at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source)
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source)
    at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source)
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source)
    at java.util.stream.ReferencePipeline.findFirst(Unknown Source)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:368)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
    at org.openqa.selenium.ie.InternetExplorerDriver.run(InternetExplorerDriver.java:220)
    at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:212)
    at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:158)
    at Sanity.FireFox.main(FireFox.java:19)

    I am getting above error message. I am trying to open IE browser using selenium. Please help me out.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.