3

I'm testing a web application using selenium. Here, I'm writing the selenium test in Javascript. But I couldn't find a way to automate SSL certs acceptance.

Using the profile class I tried doing something like this:

Is there anything I’m missing?

var profile = new firefox.Profile() profile.setAcceptUntrustedCerts(true)

var options = new firefox.Options().setProfile(profile)

var firefoxDriver = new web driver.Builder() .forBrowser(‘firefox’) .usingServer(‘http://127.0.0.1 :4444/wd/hub’) .setFirefoxOptions(options) .build()

firefoxDriver.get(url)

But this doesn't seems to work. Is there any way I can write a bash script(which I can call in my test) or is there any other way in Javascript that accept SSL certs?

Dana
  • 139
  • 1
  • 10
  • Possible duplicate of [How to deal with certificates using selenium?](http://stackoverflow.com/questions/24507078/how-to-deal-with-certificates-using-selenium) – JeffC Nov 07 '15 at 04:43
  • how do you pass the profile to webdriver? Have you tried `profile. assumeUntrustedCertIssuer(true)`? – danielepolencic Nov 07 '15 at 17:31
  • @danielepolencic profile.assumeUntrustedCertIssuer(true) doesn't work? Any other suggestions? – Dana Nov 09 '15 at 18:59
  • @JeffC That's not working in javascript. I'm using similar methods in javascript: Is there anything I’m missing? var profile = new firefox.Profile() profile.setAcceptUntrustedCerts(true) var options = new firefox.Options().setProfile(profile) var firefoxDriver = new web driver.Builder() .forBrowser(‘firefox’) .usingServer(‘http://127.0.0.1 :4444/wd/hub’) .setFirefoxOptions(options) .build() firefoxDriver.get(url) – Dana Nov 12 '15 at 20:13

1 Answers1

0

Did you try this? profile.setAcceptUntrustedCertificates(true);

Rahul
  • 759
  • 3
  • 21
  • 43
  • Hi, thanks for your reply. I’m trying the following but it doesn’t work. Is there anything I’m missing? var profile = new firefox.Profile() profile.setAcceptUntrustedCerts(true) var options = new firefox.Options().setProfile(profile) var firefoxDriver = new web driver.Builder() .forBrowser(‘firefox’) .usingServer(‘http://127.0.0.1 :4444/wd/hub’) .setFirefoxOptions(options) .build() firefoxDriver.get(url) – Dana Nov 12 '15 at 20:12