What are you trying to achieve? (Expected behavior)
I want to set a UserAgent and MobileEmulation when i start a browser on selenium.
For this, i'm using ChromeOption class.
In fact, Google Chrome Driver has changed the option name to manipulate browser arguments. Since version 2.31, the option name is not chromeOptions but goog:chromeOptions :
When I change the name in ChromeOptions class, it's works fine.
=> Can you update the code please ?
What do you get instead? (Actual behavior)
The user-agent is set on chromeOptions but when the browser is stated the user-agent is not applied
How could the issue be reproduced? (Steps to reproduce)
$desired_capabilities = DesiredCapabilities::chrome();
$options = new ChromeOptions();
$options->addArguments(array('--user-agent=Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X Tests_Autos; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10'));
$desired_capabilities->setCapability(ChromeOptions::CAPABILITY, $options);
$this->webDriver = RemoteWebDriver::create($selenium_server, $desired_capabilities);
Details
- Php-webdriver version: 1.5
- PHP version: 5.6
- Selenium server version: 3.11
- Operating system: Ubuntu 16.04
- Browser used + version: Google Chrome 66.0.3359.181
What are you trying to achieve? (Expected behavior)
I want to set a UserAgent and MobileEmulation when i start a browser on selenium.
For this, i'm using ChromeOption class.
In fact, Google Chrome Driver has changed the option name to manipulate browser arguments. Since version 2.31, the option name is not chromeOptions but goog:chromeOptions :
When I change the name in ChromeOptions class, it's works fine.
=> Can you update the code please ?
What do you get instead? (Actual behavior)
The user-agent is set on chromeOptions but when the browser is stated the user-agent is not applied
How could the issue be reproduced? (Steps to reproduce)
Details