17

Just in case someone sees that post , I added : cOptions.setExperimentalOption("excludeSwitches", Arrays.asList("enable-automation")); And it caused the driver to crash when calling: driver().manage().window().maximize(); So I had to remove it. Anyway , Adding : options.addArguments("disable-infobars"); solved the original issue. Thank you all for ...


12

See the answer to "ChromeDriver user preferences ignored" cOpt.AddUserProfilePreference("credentials_enable_service", false); cOpt.AddUserProfilePreference("profile.password_manager_enabled", false);


8

Not Working I've tried the --lang=us option, as suggested, but also had no success using the code below. My webpages were still being downloaded with my default language (that's not en). from selenium import webdriver options = webdriver.ChromeOptions() options.add_argument('lang=en') # options.add_argument('--lang=en') <- Tried this option as well ...


7

In Java: ChromeOptions options = new ChromeOptions(); options.addArguments("--start-maximized"); options.addArguments("--disable-web-security"); options.addArguments("--no-proxy-server"); Map<String, Object> prefs = new HashMap<String, Object>(); prefs.put("credentials_enable_service", false); prefs.put("profile.password_manager_enabled", false)...


7

There is not any way to automate captcha submission. Actually, that's the reason captcha is used for. All you can do are: ReCAPTCHA's documentation provides a set of keys that you can use for testing. You can also whitelist your testing domains for exclusion. Run your tests on a development or staging environment and disable the CAPTCHA in that environment. ...


6

Sadly none of the answers above are explaining what the real question here is. To understand how the chromedriver works fundamentally, you need to understand the root first. What is WebDriver anyway? Selenium WebDriver or WebDriver, as it is called, is actually an open source tool for automating testing of web-apps across many browsers. It does that by ...


6

Here is the completed example that demonstrates how you can modify requests from your Selenium tests. To demonstrate one I have created a sample REST mock service via SoapUI that would return just a {"SUCCESS"} message for any response. The test code (TestNg is used for test running, and borwsermob-proxy for proxying requests): public class MiscTests { ...


5

It looks like you simply need to encode the file to a base64 string: chromeOptions : { extensions: [encode('./extension_1_5.crx')] } function encode(file) { var stream = require('fs').readFileSync(file); return new Buffer(stream).toString('base64'); }


5

Solution for Python 3: from selenium import webdriver from selenium.webdriver.chrome.options import Options chrome_options = Options() chrome_options.add_argument("--disable-infobars") browser = webdriver.Chrome(executable_path = path_to_chromedriver,chrome_options=chrome_options)


5

I think you just need to re-raise the assertion error after printing out log messages: try: self.assertEqual(len(self.verificationErrors), 0) # no errors except AssertionError as e: for message in self.verificationErrors: print(str(message)) raise # < HERE Also, if you want to check for severe console messages after every single ...


3

You can use ChromeOptions options = new ChromeOptions(); options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation")); Also, it's better to use Collections.singletonList instead of Arrays.asList since we are passing in a single argument to excludeSwitches. Disabling the infobar using --disable-infobars flag will ...


3

What Flavio Barisi said, with the addition of the capabilities you pass to your driver. ChromeOptions options = new ChromeOptions(); options.addArguments("--start-maximized"); Map<String, Object> prefs = new HashMap<String, Object>(); prefs.put("credentials_enable_service", false); prefs.put("profile.password_manager_enabled", false); options....


3

I have seen the same thing, our box that runs our automation has been running out of space. We found out that Chrome was the culprit. I don't have the answer to solve the root problem, but I have created a batch script that I have scheduled to run daily on windows machine that cleans up all the temporary folders. To create a batch file just open notepad, ...


3

Disable-infobars flag has been removed per this merged commit below. for more details check here: 1. chromium.googlesource.com 2. chromium-review.googlesource.com This flag is no longer needed by the perf testing infrastructure and can be misused for malicious purposes, so remove it. Update April 18, 2018: --disable-infobars has been added back to ...


3

In your code you should instantiate two drivers. One instance for Chrome and the second one for IE. Now you can operate with both the browsers. Below is the example in Java: public static void main(String[] args) { // Configure both drivers System.setProperty("webdriver.chrome.driver", "Path to your chromedriver"); System.setProperty("webdriver....


3

Oh blah! https://stackoverflow.com/questions/45372066/is-it-possible-to-run-google-chrome-in-headless-mode-with-extensions/45372648#45372648 Firefox supports headless extensions but not google chrome. :(


3

use the below code driver.get(enter the url); ((JavascriptExecutor)driver).executeScript("window.open()"); ((JavascriptExecutor)driver).executeScript("window.open()"); ArrayList<String> tabs = new ArrayList<String>(driver.getWindowHandles()); driver.switchTo().window(tabs.get(1)); driver.get("http://google.com");


3

You can run ChromeDriver in silent mode. When you execute ChromeDriver, you have to set the log level in the command line arguments: chromedriver --log-level=OFF Similar post in (StackOverflow) https://stackoverflow.com/questions/18702533/how-to-execute-selenium-chrome-webdriver-in-silent-mode Edit --log-level=3 offer a minimal amount of logs, but if ...


3

Driver d1 = new Driver(profile); d1.start(); Driver d2 = new Driver(profile1); d1.start(); Here you create Driver d2 but start d1.start() the second time then (you have started it two lines of code before)


3

Why not use an API that downloads the Webdriver, sets the environment variables and removes the issue of updating the path if the project is shared on another computer/server? This would do : https://github.com/bonigarcia/webdrivermanager


3

Selenium doesn't have API to do that. You need to use something external. As Alexey suggested one of the solutions would be setting up proxy like this.


3

You cannot achieve it by Selenium, but as you mentioned you are using BrowserMobProxy , I would recommend you to try once below . Apache Module mod_headers ( Refer : http://httpd.apache.org/docs/current/mod/mod_headers.html#page-header ) You can also install Fiddler (http://www.fiddler2.com/fiddler2/) which is very easy to install (easier than Apache for ...


2

Try and convert this to the Python equivalent. Check this link: For Firefox: FirefoxProfile profile = new FirefoxProfile(); profile.setPreference( "intl.accept_languages", "es" ); WebDriver driver = new FirefoxDriver(profile); For Chrome: ChromeOptions options = new ChromeOptions(); options.AddArguments("--lang=es"); ChromeDriver driver = new ...


2

This is works for me (in python): from selenium import webdriver options = webdriver.ChromeOptions() options.add_experimental_option("excludeSwitches", ["ignore-certificate-errors"]) webdriver_instance = webdriver.Chrome(chrome_options=options) See also: https://stackoverflow.com/questions/24507078/how-to-deal-with-certificates-using-selenium and https://...


2

From Selenium Documentation: You may, or may not, need the Selenium Server, depending on how you intend to use Selenium-WebDriver. If your browser and tests will all run on the same machine, and your tests only use the WebDriver API, then you do not need to run the Selenium-Server; WebDriver will run the browser directly. There are some ...


2

Hope you are using appium server with Appium application. Solution: Open Appium.exe Go to settings and click on it. Select "Over ride existing sessions" and click on it. Bingo you are done.


2

This might be because of race conditions in asynchronous test code. It is always better to escape non-alphanumerical characters. If that doesn't work you could always put delays/timeouts between typing characters. Another useful hint might be found here


2

Be sure that you have enabled automated test runs for Safari: Ensure that the Develop menu is available. It can be turned on by opening Safari preferences (Safari > Preferences in the menu bar), going to the Advanced tab, and ensuring that the Show Develop menu in menu bar checkbox is checked. Enable Remote Automation in the Develop menu. 1.This is ...


2

When your Python Selenium bindings locate the chromedriver executable and try to execute it, they are unable to do so because of an issue with permissions. Most likely, your chromedriver executable is missing "execute" permissions, add them: sudo chmod +x `which chromedriver` # or sudo chmod +x /path/to/chromedriver


2

Looks like something wrong is with your selenium client JAR - it is probably not compatible with the Chrome version you are using. Download and use the latest (currently 3.5.3) selenium client library.


Only top voted, non community-wiki answers of a minimum length are eligible