Closed Sniperfairy closed 9 years ago
Yeah that's an issue with the GhostDriver - try adding to your desiredCapabilities “phantomjs.cli.args”: [“—ignore-ssl-errors=true”]
We tried that as well but it did not work properly either.
For that command to work, does the selenium grid have to be running?
I am also facing same issue at the moment. I am passing cli argument like this:-
"phantomjs.cli.args": "--acceptSslCerts=true --web-security=no --ignore-ssl-errors=yes --ssl-protocol=any --webdriver=5558 --webdriver-selenium-grid-hub=http://localhost:4444"
but I see ,"acceptSslCerts":false in negotiated capabilities:-
CONSTRUCTOR - Desired Capabilities: {"acceptSslCerts":true,"phantomjs.binary.path":"node_modules/resources/phantomjs/bin/phantomjs","name":"Sample Test","browserName":"phantomjs","javascriptEnabled":true,"phantomjs.cli.args":"--acceptSslCerts=true --web-security=no --ignore-ssl-errors=yes --ssl-protocol=any --webdriver=5558 --webdriver-selenium-grid-hub=http://localhost:4444","platform":"ANY"}
CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}'
Did any one solve this issue?
I was able to get it working with how I specified above (note the array). You may also try upgrading your phantomjs version to 2.0.
One other thing - I'm not sure the logging was ever correct coming from ghostdriver (I am not currently at my computer to check). I suggest adding a simple UI test like checking for a the existence of element to see if it worked.
On Aug 13, 2015, at 4:27 AM, sharad jain notifications@github.com wrote:
I am also facing same issue at the moment. I am passing cli argument like this:-
"phantomjs.cli.args": "--acceptSslCerts=true --web-security=no --ignore-ssl-errors=yes --ssl-protocol=any --webdriver=5558 --webdriver-selenium-grid-hub=http://localhost:4444" but I see ,"acceptSslCerts":false in negotiated capabilities:-
CONSTRUCTOR - Desired Capabilities: {"acceptSslCerts":true,"phantomjs.binary.path":"node_modules/resources/phantomjs/bin/phantomjs","name":"Sample Test","browserName":"phantomjs","javascriptEnabled":true,"phantomjs.cli.args":"--acceptSslCerts=true --web-security=no --ignore-ssl-errors=yes --ssl-protocol=any --webdriver=5558 --webdriver-selenium-grid-hub=http://localhost:4444","platform":"ANY"} CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}' Did any one solve this issue?
— Reply to this email directly or view it on GitHub.
Thank you very much! From: Stephanie Madison notifications@github.com To: nightwatchjs/nightwatch nightwatch@noreply.github.com Cc: Sniperfairy samantha.stachowiak@yahoo.com Sent: Thursday, August 13, 2015 9:22 AM Subject: Re: [nightwatch] acceptSslCerts for PhantomJS not working properly (#582)
I was able to get it working with how I specified above (note the array). You may also try upgrading your phantomjs version to 2.0.
One other thing - I'm not sure the logging was ever correct coming from ghostdriver (I am not currently at my computer to check). I suggest adding a simple UI test like checking for a the existence of element to see if it worked.
On Aug 13, 2015, at 4:27 AM, sharad jain notifications@github.com wrote:
I am also facing same issue at the moment. I am passing cli argument like this:-
"phantomjs.cli.args": "--acceptSslCerts=true --web-security=no --ignore-ssl-errors=yes --ssl-protocol=any --webdriver=5558 --webdriver-selenium-grid-hub=http://localhost:4444" but I see ,"acceptSslCerts":false in negotiated capabilities:-
CONSTRUCTOR - Desired Capabilities: {"acceptSslCerts":true,"phantomjs.binary.path":"node_modules/resources/phantomjs/bin/phantomjs","name":"Sample Test","browserName":"phantomjs","javascriptEnabled":true,"phantomjs.cli.args":"--acceptSslCerts=true --web-security=no --ignore-ssl-errors=yes --ssl-protocol=any --webdriver=5558 --webdriver-selenium-grid-hub=http://localhost:4444","platform":"ANY"} CONSTRUCTOR - Negotiated Capabilities: {"browserName":"phantomjs","version":"1.9.2","driverName":"ghostdriver","driverVersion":"1.0.4","platform":"mac-unknown-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}' Did any one solve this issue?
— Reply to this email directly or view it on GitHub.
— Reply to this email directly or view it on GitHub.
Sounds like this is resolved, so closing this out.
Just to give an update to anybody that is looking to resolve the issue:
This is a phantomjs configuration issue. Sorry for replaying so late.
Hi All, I am getting below error when i try to handle an element using phantom js in C#
Please help me in this
Thanks Manu
The localhost that my company uses has a https://localhost: ### url. When running through Google Chrome or Mozilla Firefox, the "acceptSslCerts" : true works properly and automatically proceeds to the expected page.
For PhantomJS, this is not the case. In my test document, the first instruction is client.insert.title('Title'). Upon running this test, I kept receiving a failed test result that read "Testing if the page title equals "Title".: Expected "Title" but got: """. This indicated that the test was not going to the proper page when running through nightwatch-phantomjs. I tried registering phantomjs through the Selenium Grid for GhostDriver, attempted different setting in the nightwatch.json file, and rewrote tests that relied not on imagery but on the HTML codes, such as looking for titles or words.
A co-worker and I figured out that the ssl warning page actually doesn't have properties like a title and came to the conclusion that the acceptSslCerts actually do not work in phantomjs. We could not find documentation anywhere to fix this issue, which is why I am reporting it here. To verify this, we changed all of our urls to http://localhost:####, after which, the tests started to pass again. Currently, we are trying to figure out a way to work around this without having to purchase a ssl certificate.
If there is anymore information I can provide or if there is a solution that I am missing, please let me know. This is the first time I am submitting an issue through GitHub and there might be different policies that I am unaware of. Really, I posted this as a means to help another user in the future if they come across this problem.
Attached, I have my nightwatch.json file that may help as a reference.