42 votes

How do I close the browser window at the end of a Selenium test?

driver.close() and driver.quit() are two different methods for closing the browser session in Selenium WebDriver. driver.close() - It closes the the browser window on which the focus is set. driver....
user avatar
17 votes

Chrome driver 2.28: "Chrome is being controlled by automated test software" notification. Can it be removed?

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()....
user avatar
13 votes

How to set browser locale with chromedriver (Python)

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 ...
user avatar
  • 231
13 votes

How to disable Chrome save your password? (Selenium Java)

See the answer to "ChromeDriver user preferences ignored" cOpt.AddUserProfilePreference("credentials_enable_service", false); cOpt.AddUserProfilePreference("profile.password_manager_enabled", false);
user avatar
  • 131
9 votes
Accepted

How does chromedriver.exe work on a core and fundamental level

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 ...
user avatar
  • 3,520
8 votes

How to disable Chrome save your password? (Selenium Java)

In Java: ChromeOptions options = new ChromeOptions(); options.addArguments("--start-maximized"); options.addArguments("--disable-web-security"); options.addArguments("--no-proxy-server"); Map<...
user avatar
7 votes
Accepted

How to handle a ReCAPTCHA picture?

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....
user avatar
  • 624
7 votes
Accepted

How to modify HTTP request header in Selenium WebDriver with Java?

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 {"...
user avatar
  • 11.4k
6 votes

Chrome driver 2.28: "Chrome is being controlled by automated test software" notification. Can it be removed?

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 = ...
user avatar
  • 161
5 votes
Accepted

Error trying to add chrome extension in nightwatchjs

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')....
user avatar
5 votes
Accepted

Try Assert Exceptions not failing test in python unittest or better way to loop through failures

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 ...
user avatar
  • 11.4k
5 votes
Accepted

Selenium + ChromeDriver + Headless Chrome - failed to wait for extension background page to load

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 ...
user avatar
4 votes

Chromedriver not deleting scoped* dir in temp folder after test is complete

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 ...
user avatar
4 votes

Can I automate multiple isolated chrome instances with Selenium ChromeDriver

I'm not sure how you tested your sessions issue but having two webdrivers in parallel is a normal case and there should not be issues with cookies or whatever. Below is my test written in Java but you ...
user avatar
  • 11.4k
4 votes

Multithreading: chromedriver does not open url in second window

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 ...
user avatar
  • 11.4k
4 votes
Accepted

Selenium webdriver is getting log entries for the server event "500 internal server error" when using GetLog(LogType.Browser)

LogType.Browser is intended to show the javascript errors that you can observe in browser's JS-console. So if the log message appears in that console, then you'll see such the message there. LogType....
user avatar
  • 11.4k
4 votes

Disable physical mouse and keyboard in selenium

You should not be running tests on a machine used by user(s). Set up a dedicated computer or VM for testing and and use headless browser mode (more info here and here).
user avatar
  • 1,016
4 votes

Chromedriver quit() method doesn't close all chrome.exe processes

Yeah, it can be a general issue as browsers (especially Chrome) don't always like closing their driver processes. You can put the below in the onFinish all tests method which kills them: String ...
user avatar
  • 514
4 votes

How to autoupdate Chrome-driver in Selenium?

Yes, it can be done. You need to follow these steps, and you need to choose a tool in which you implement them. Let's have a look at a few lines in Python, I'll outline the main flow and you might ...
user avatar
  • 4,278
4 votes

How to autoupdate Chrome-driver in Selenium?

Try using webdriver-manager from npm: https://www.npmjs.com/package/webdriver-manager And call webdriver-manager update using batch file from your java, python or what ever tool . To create batch ...
user avatar
  • 10.8k
4 votes
Accepted

How do I enable ChromeDriver to use browser cache or local storage with selenium python

Yes, you are right, from Chrome capabilities documentations Use custom profile (also called user data directory) By default, ChromeDriver will create a new temporary profile for each session. ...
user avatar
  • 166
3 votes

Chrome driver 2.28: "Chrome is being controlled by automated test software" notification. Can it be removed?

You can use ChromeOptions options = new ChromeOptions(); options.setExperimentalOption("excludeSwitches", Collections.singletonList("enable-automation")); Also, it's better to use Collections....
user avatar
3 votes

Selenium send_keys on chromium confused by forward slashes

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 ...
user avatar
  • 61
3 votes

How do I close the browser window at the end of a Selenium test?

In Python, using selenium webdriver for Chrome, I needed to call stop_client() before close(): from selenium import webdriver in setUp(): options = webdriver.chrome.options.Options() options....
user avatar
  • 131
3 votes

How to disable Chrome save your password? (Selenium Java)

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&...
user avatar
3 votes

Issue executing Automation with Selenium/Nosetest set ups

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 ...
user avatar
  • 11.4k
3 votes
Accepted

Force a browser's visibility setting to true

It's possible to force this status with a Javascript injection via execute_script. To simulate a visible document: Object.defineProperty(document, 'visibilityState', {value: 'visible', writable: ...
user avatar
3 votes

Chrome argument "--disable-infobars" does not work with Chrome 65

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 ...
user avatar
  • 39
3 votes

Need to work on Chrome and IE concurrently in Selenium; Any possible workaround?

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(...
user avatar
  • 11.4k
3 votes
Accepted

How to open two separate tabs in same google chrome window using webdriver and java?

use the below code driver.get(enter the url); ((JavascriptExecutor)driver).executeScript("window.open()"); ((JavascriptExecutor)driver).executeScript("window.open()"); ArrayList<String> tabs = ...
user avatar
  • 516

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