Im currently making an acceptance test with the following tools:
My problem is My Tests fail when visiting a self-signed (https) page
What I've tried:
phantomjs --webdriver=5555 --ignore-ssl-errors=true --ssl-protocol=any
phantomjs.cli.args: ["--ignore-ssl-errors=true"]
in my acceptance.suit.ymlSo far these options doesnt give me any luck.
Here is my acceptance.suit.yml
file
class_name: AcceptanceTester
modules:
enabled:
- WebDriver
config:
WebDriver:
url: https://myproject.com
browser: firefox
capabilities:
unexpectedAlertBehaviour: 'accept'
env:
phantom:
modules:
enabled:
- WebDriver
config:
WebDriver:
url: https://myproject.com
http_proxy: 192.1.1.1
http_proxy_port: 3000
browser: phantomjs
capabilities:
phantomjs.cli.args: ["--ignore-ssl-errors=true"]
UPDATE
This error shows up [ModuleException] WebDriver: Current url is blank, no page was opened
I don't know why this error happens since I've indicated a page. Here is a sample of my test
public function tryToTestThis(AcceptanceTester $I)
{
$I->wantTo('Test this function');
$I->amOnPage('/mypage/');
$I->see('This text');
}
An answer in Codeception would be preferable. Thanks
We figured out the cause if this problem. It was because I was running Selenium
and phantomJS
at the same time. (I got this idea from some tutorial.)
I was doing
java -jar selenium.jar
then I do this since it causes an error running phantomjs at port 4444 (Obviously selenium is using it) I use port 5555 instead.
phantomjs --webdriver=5555 --ignore-ssl-errors=true --ssl-protocol=any
Note: Everything works fine if not involved with https / ssl self-signed pages.
We think that codeception
prioritize port 4444 and disregarding any option indicated in my phantomjs i.e. --ignore-ssl-errors=true --ssl-protocol=any
thats why in fails to visit https/self-signed pages.
So basically, the fix was just running phantomjs alone without selenium.
phantomjs --webdriver=4444 --ignore-ssl-errors=true --ssl-protocol=any
Thank you
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With