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

Comments

Projects
None yet
8 participants
@priidikvaikla
Contributor

priidikvaikla commented Dec 22, 2015

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

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Dec 22, 2015

Member

It is a bug.

Member

Naktibalda commented Dec 22, 2015

It is a bug.

Naktibalda added a commit that referenced this issue Dec 24, 2015

@tivnet

This comment has been minimized.

Show comment
Hide comment
@tivnet

tivnet Dec 28, 2015

Contributor

To define a "no proxy" in the yml:

    config:
        WebDriver:
            ...
            http_proxy: direct
Contributor

tivnet commented Dec 28, 2015

To define a "no proxy" in the yml:

    config:
        WebDriver:
            ...
            http_proxy: direct

@Naktibalda Naktibalda closed this Dec 30, 2015

@ashnazg

This comment has been minimized.

Show comment
Hide comment
@ashnazg

ashnazg Dec 30, 2015

Contributor

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?

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

This comment has been minimized.

Show comment
Hide comment
@jepster

jepster 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?

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

This comment has been minimized.

Show comment
Hide comment
@tivnet

tivnet Jan 6, 2016

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@ashnazg

ashnazg Jan 6, 2016

Contributor

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

Contributor

ashnazg commented Jan 6, 2016

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

@jepster

This comment has been minimized.

Show comment
Hide comment
@jepster

jepster 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. :)

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

This comment has been minimized.

Show comment
Hide comment
@ashnazg

ashnazg Jan 6, 2016

Contributor

@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 👍

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

This comment has been minimized.

Show comment
Hide comment
@tivnet

tivnet Jan 6, 2016

Contributor

@jepster I downgraded with composer

"codeception/codeception": "2.1.4"

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

is a must. WebDriver won't work otherwise.

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

This comment has been minimized.

Show comment
Hide comment
@jepster

jepster 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.

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

This comment has been minimized.

Show comment
Hide comment
@freinn

freinn Jan 8, 2016

You saved my life bros. Thank you.

freinn commented Jan 8, 2016

You saved my life bros. Thank you.

@agarzon

This comment has been minimized.

Show comment
Hide comment
@agarzon

agarzon Jan 28, 2016

Contributor

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

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

Added settings for connecting to phantomjs
Note the http_proxy: direct is necessary because
of a bug.  See:
Codeception/Codeception#2651
@FelikZ

This comment has been minimized.

Show comment
Hide comment
@FelikZ

FelikZ Mar 8, 2016

2.1.6 - still broken

FelikZ commented Mar 8, 2016

2.1.6 - still broken

@Naktibalda

This comment has been minimized.

Show comment
Hide comment
@Naktibalda

Naktibalda Sep 28, 2016

Member

Fixed by #2660

Member

Naktibalda commented Sep 28, 2016

Fixed by #2660

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment