I was trying to navigate to a web page which is not secured.

When I try to do this using PhantomJS, it's not navigating the web page. I can see that by debugging the code.

So, how should I navigate to the "Not Secured" web page using PhantomJS?

Below is my code.

driver = new PhantomJSDriver(@"C:\Driver\phantomjs\");
  • 1
    What does "not secured" mean?
    – Alexey R.
    Sep 19, 2018 at 7:30
  • When the SSL certificate expired ,We need t manualy add an exception to the web browser. I think web sites not having https
    – ChathuD
    Sep 19, 2018 at 14:35
  • 1
    In your example you're trying to access to http resource. Hence certificates would not be checked there in any way. There might be an issue when server does not allow http connections though.
    – Alexey R.
    Sep 19, 2018 at 14:37
  • 1
    If you have certificate validation issues, try to apply the solution suggested here: stackoverflow.com/questions/24507078/…. This is for python language however the concept can be migrated to any other language.
    – Alexey R.
    Sep 19, 2018 at 14:39
  • @alaexey R you are awesome. I found the answer.
    – ChathuD
    Sep 20, 2018 at 3:20

1 Answer 1


I was able to do this on .net c# with PhantomJSDriver with selenium web driver 3.1

public void headless()

    var driverService = PhantomJSDriverService.CreateDefaultService(@"C:\Driver\phantomjs\");
    driverService.SuppressInitialDiagnosticInformation = true;
    driver = new PhantomJSDriver(driverService);


  • You can accept your own question as an answer to marked them answered. Apr 19, 2019 at 12:12

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.