How to Stop Chromedriver from Opening Settings Tab Automatically

How to stop chromedriver from opening settings tab automatically?

Update: I updated the chromedriver to 2.33 that the selenium-standalone package uses and the config of the selenium server. The tab is not appearing anymore. You can try to update the chromedriver that your ruby script uses to 2.33.

If you need my Chrome version, it is currently 62.0.3202.89 (64 bit) for Mac OS.

I ran into this issue when I tried to used our selenium automation in nodejs. I tried the new chromedriver 2.33 but the issue persisted. I just downgraded my Chrome to version 59 at the moment until it can be fixed.

How to close newly constructed tab using selenium, chrome driver and python

You could try this solution.

# New tabs will be the last object in window_handles
driver.switch_to.window(driver.window_handles[-1])

# close the tab
driver.close()

# switch to the main window
driver.switch_to.window(driver.window_handles[0])

Reference: http://antlong.com/common-operations-working-with-tabs-in-webdriver/

Python selenium keep browser open

If you want chrome and chromedriver to stay open, you have to use the 'detach' option when starting chromedriver.

In your case add :

from selenium.webdriver.chrome.options import Options
chrome_options = Options()
chrome_options.add_experimental_option("detach", True)

before you pass in the options to the browser

browser = webdriver.Chrome('drivers/chromedriver.exe', chrome_options=chrome_options)

Or you can run the code in debug mode with breakpoint at the end and when it pauses 'kill' the program and take over the browser if you want to, but this works in IDE only.

EDIT - added the import for clarity



Related Topics



Leave a reply



Submit