Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDriverException when no proxy config defined #2651

Closed
priidikvaikla opened this issue Dec 22, 2015 · 14 comments
Closed

WebDriverException when no proxy config defined #2651

priidikvaikla opened this issue Dec 22, 2015 · 14 comments

Comments

@priidikvaikla
Copy link
Contributor

If no proxy capabilities are defined in acceptance.suite.yml I get

[Facebook\WebDriver\Exception\WebDriverException]
JSON decoding of remote response failed.
Error code: 4
The response: 'TypeError - null is not an object (evaluating 'proxyCapability["proxyType"]')'

https://github.com/Codeception/Codeception/blob/2.1/src/Codeception/Module/WebDriver.php#L195 I get null from $this->getProxy() and $this->capabilities contents are set

array(3) {
  ["unexpectedAlertBehaviour"]=>
  string(6) "accept"
  ["browserName"]=>
  string(9) "phantomjs"
  ["proxy"]=>
  NULL
}

Is there somekind of mistake or should the documentation be updated?

@Naktibalda
Copy link
Member

It is a bug.

Naktibalda added a commit that referenced this issue Dec 24, 2015
@tivnet
Copy link
Contributor

tivnet commented Dec 28, 2015

To define a "no proxy" in the yml:

    config:
        WebDriver:
            ...
            http_proxy: direct

@ashnazg
Copy link
Contributor

ashnazg commented Dec 30, 2015

This bug manifests itself on the Chrome driver in this manner:
Facebook\WebDriver\Exception\UnknownServerException: unknown error: cannot parse capability: proxy from unknown error: must be a dictionary

This was a showstopper for the Chrome driver, as it would not even reach the point of opening the browser. I tested it against driver versions v2.20 all the way back to 2.14.

I can confirm that @tivnet 's suggestion of http_proxy: direct is a good workaround against the 2.1.5 release.

I can confirm that this fix (as tested in the current 2.1.x-dev at a687fba) does solve the issue, without needing the extra config as a workaround.

Is a 2.1.6 expected soon, to get this fix released to us Chrome testers?

@Naktibalda Naktibalda reopened this Dec 31, 2015
@jepster
Copy link

jepster commented Jan 6, 2016

If I specify

http_proxy: direct

I'm getting only empty pages with webdriver (PhantomJS). The error is then:

[ModuleException] WebDriver: Current url is blank, no page was opened

Tested different urls. I'm in a Vagrant box. Does I "have" to specify any proxy?

@tivnet
Copy link
Contributor

tivnet commented Jan 6, 2016

I wrote about "http_proxy", but later I started getting all kind of weird errors, so finally I downgraded codeception and live happily ever since.

@ashnazg
Copy link
Contributor

ashnazg commented Jan 6, 2016

@tivnet , I had another big issue on 2.1.5 too ... see #2684.

@jepster
Copy link

jepster commented Jan 6, 2016

@tivnet: Which version is working for you? Do you know where I can get the phar archive for this version? If not - no problem, I would download it via composer. But prefering phar at the moment. :)

@ashnazg
Copy link
Contributor

ashnazg commented Jan 6, 2016

@jepster : right now, the only 2.1.x that's been a problem for me is 2.1.5. Thus, in my own composer.json, I have:

"codeception/codeception": "~2.1 !=2.1.5",

All versions of PHARs are listed at http://codeception.com/builds.

I'm hoping that #2684 will get merged and a 2.1.6 release goes out soon 👍

@tivnet
Copy link
Contributor

tivnet commented Jan 6, 2016

@jepster I downgraded with composer

"codeception/codeception": "2.1.4"

Remember:
"minimum-stability": "stable",

is a must. WebDriver won't work otherwise.

@jepster
Copy link

jepster commented Jan 7, 2016

Thanks! Installed Codeception globally via composer by the following entry:

"codeception/codeception": "~2.1 !=2.1.5"

I can confirm that it works now.

@freinn
Copy link

freinn commented Jan 8, 2016

You saved my life bros. Thank you.

@agarzon
Copy link
Contributor

agarzon commented Jan 28, 2016

I can confirm this issue. My solution was to downgrade to 2.1.4

hirowatari added a commit to hirowatari/Docker-for-Wordpress-Plugin-Testing that referenced this issue Feb 5, 2016
Note the http_proxy: direct is necessary because
of a bug.  See:
Codeception/Codeception#2651
@FelikZ
Copy link

FelikZ commented Mar 8, 2016

2.1.6 - still broken

@Naktibalda
Copy link
Member

Fixed by #2660

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants