You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
useragent not apply on Chrome with docker Selenium #573
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 :
$desired_capabilities = DesiredCapabilities::chrome();
$options = newChromeOptions();
$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
Reacted by Akin Delamarre, Thomas, Gordon Franke, Tufan Kılıçaslan, Ferga Dipa, Ankit Sharma, crazyfree and Kyle Pittman
Activity
crazyfree commentedon Jun 6, 2019
I also can't set mobileEmulation
Details:
Kindly support
OndraM commentedon Nov 11, 2019
This should be resolved by #673 and fixed in next php-webdriver release.