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

Problem possible bug Selenium WebDriver module use advanced settings proxy #53

Open
monstrodopantano opened this issue Dec 15, 2016 · 2 comments

Comments

@monstrodopantano
Copy link

What are you trying to achieve?

What do you get instead?

Provide console output if related. Use -vvv mode for more details.

codecept run acceptance --steps

Provide test source code if related
Does not work in this setting in acceptance.suite.yml

class_name: AcceptanceTester
modules:
    enabled:
        - WebDriver:
            url: 'http://myproject.dev'
            browser: firefox
            window_size: maximize
            capabilities:
                proxyType: 'manual'
                noProxy: 'localhost, 127.0.0.1, *.dev'
                httpProxy: '10.255.100.1:3128'
                sslProxy: '10.255.100.1:3128'
        - \Helper\Acceptance

#File vendor/codeception/codeception/src/Codeception/Module/WebDriver.php
Method _initialize() line 293-295
For my solution neccessary alter manual for settings use no proxy for in runtime browser.
Sets Selenium2 desired capabilities. Should be a key-value array proxy
https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities#proxy-json-object

My problem was to inform the browser the list of url no proxy in capabilities [noProxy]

if ($proxy = $this->getProxy()) {
            $this->capabilities[WebDriverCapabilityType::PROXY] = $proxy;
}
#My solution
if ($proxy = $this->getProxy()) {
            $this->capabilities[WebDriverCapabilityType::PROXY] = array(
                    'proxyType' => 'manual',
                    'noProxy' => 'localhost, 127.0.0.1, *.dev ',
                    'httpProxy' => '10.255.100.1:3128',
                    'sslProxy' => '10.255.100.1:3128'
                );
        }

Details

  • Codeception version: 2.2.7
  • PHP Version: 7.0
  • Operating System: Debian 8
  • Installation type: Phar || Composer
  • List of installed packages (composer show)
  • Suite configuration:
# paste suite config here
@monstrodopantano monstrodopantano changed the title Problem Selenium WebDriver module use advanced settings proxy Problem possible bug Selenium WebDriver module use advanced settings proxy Dec 15, 2016
@monstrodopantano
Copy link
Author

monstrodopantano commented Feb 20, 2018

Help I wonder team can solve this problem. Always when updating I have to manually change here in the company to skip the proxy I imagine that others go through this. @DavertMik @samdark

@Naktibalda
Copy link
Member

It was possible to set sslProxy settings in WebDriver configuration even back in 2016.

modules:
    enabled:
        - WebDriver:
            url: 'http://myproject.dev'
            browser: firefox
            window_size: maximize
            http_proxy: '10.255.100.1:3128'
            ssl_proxy: '10.255.100.1:3128'

The only missing setting was no_proxy, you could have raised a pull request to add handling of no_proxy to getProxy method.
New location of WebDriver class is https://github.com/Codeception/module-webdriver/blob/master/src/Codeception/Module/WebDriver.php

I found this example of setting no_proxy=localhost as environment variable of chromedriver.

@Naktibalda Naktibalda transferred this issue from Codeception/Codeception Jan 10, 2021
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

2 participants