Sam
Sam

Reputation: 1331

Unable to open https, especially salesforce site in phantomjs

I have just started learning about headless testing and wanted to use it to test my application on salesforce.com. Salesforce is a https site and am unable to open it in phantomjs. I am using the loadspeed example to test it. I have also set the --ignore-ssl-errors argument but I still get the FAIL to load address error.

phantomjs "C:\myfolder\phantomjs
-1.9.2-windows\examples\loadspeed.js" https://test.salesforce.com --ignore-ssl-e
rrors=yes --ssl-protocol=any

another Observation:

If I try it with other https sites like https://github.com/, I am able to open those in phantomjs.

Please help in resolving this.

Upvotes: 1

Views: 1886

Answers (1)

Meti
Meti

Reputation: 365

Your using phantomjs command in wrong way. You should use in the followinf order:

phantomjs [switchs] [options] [script] [argument]

as in your example it should be:

phantomjs --ignore-ssl-errors=yes --ssl-protocol=any "C:\myfolder\phantomjs -1.9.2-windows\examples\loadspeed.js" https://test.salesforce.com

The other possibility is that you are trying to open an URL, which is secured by a login page, intended for users who have already logged in, therefor the server may returns 403 unauthorized response. If this is the case you can solve it by getting all the cookies on your browser for demo.saleforce.com and setting them on phantomjs.


Please note that there is no problem with SSL certificate of Salesforce, there is no point in turning off the SSL security. If you can't access the site without ignoring SSL error, then it's likely possible that your computer/internet connection have been compromised by some hackers. If this is the case they can just intercept your login information when you log in different websites.

Upvotes: 4

Related Questions