1

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\");
driver.Navigate().GoToUrl("http://xxx.xxx.xx.aspx");
  • 1
    What does "not secured" mean? – Alexey R. Sep 19 '18 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 '18 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 '18 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 '18 at 14:39
  • @alaexey R you are awesome. I found the answer. – ChathuD Sep 20 '18 at 3:20
1

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

[TestMethod]
public void headless()
{


    var driverService = PhantomJSDriverService.CreateDefaultService(@"C:\Driver\phantomjs\");
    driverService.SuppressInitialDiagnosticInformation = true;
    driverService.AddArgument("--web-security=no");
    driverService.AddArgument("--ignore-ssl-errors=yes");
    driver = new PhantomJSDriver(driverService);

    driver.Navigate().GoToUrl("XXXXXX.aspx");

    Thread.Sleep(6000);
}
  • You can accept your own question as an answer to marked them answered. – Niels van Reijmersdal Apr 19 at 12:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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