How to set default download directory in selenium Chrome Capabilities?

For Chromedriver try out with: String downloadFilepath = “/path/to/download”; HashMap<String, Object> chromePrefs = new HashMap<String, Object>(); chromePrefs.put(“profile.default_content_settings.popups”, 0); chromePrefs.put(“download.default_directory”, downloadFilepath); ChromeOptions options = new ChromeOptions(); options.setExperimentalOption(“prefs”, chromePrefs); DesiredCapabilities cap =; cap.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); cap.setCapability(ChromeOptions.CAPABILITY, options); WebDriver driver = new ChromeDriver(cap); Note:- Use File.separator to handle slashes, it will put syntax as per os it is … Read more

Only local connections are allowed Chrome and Selenium webdriver

This is just an informational message. Your issue might be a missmatch between the versions of chromedriver and selenium-server-standalone. Try with the latest selenium version 3.0, it is working for me. Please not that for selenium 3.0 you need to specify the driver first and after the selenium server. With the new selenium, which is … Read more

getText() method of selenium chrome driver sometimes returns an empty string

Update: The textContent attribute is a better option and supported across the majority of browsers. The differences are explained in detail at this blog post: innerText vs. textContent As an alternative, the innerText attribute will return the text content of an element which exists in the DOM. element.getAttribute(“innerText”) The isDisplayed() method can sometimes trip over … Read more

driver.manage().window().maximize() issue with ChromeDriver 2.33

There are exactly 2 issues. As you mentioned, you have installed latest chromedriver (v2.33) but the log printed below says Driver info: chromedriver=2.25.426923, this issue must be addressed first. You can consider to manually kill all the dangling chromedriver.exe tasks from the Task Manager. Additionally you can consider to use CCleaner to wipe out all … Read more

Use Selenium with Brave Browser pass service object written in python

To initiate a brave browsing context you need to: Use the binary_location attribute to point to the brave binary location. Use the chromedriver executable to initiate the brave browser. Code block: from selenium import webdriver from import Service option = webdriver.ChromeOptions() option.binary_location = r’C:\Program Files (x86)\BraveSoftware\Brave-Browser\Application\brave.exe’ driverService = Service(‘C:/Users/…/chromedriver.exe’) driver = webdriver.Chrome(service=driverService, options=option) driver.get(“”) … Read more

How to accept the popup presented when installing extension in Selenium?

Usually, you cannot test inline installation of a Chrome extension with just Selenium, because of that installation dialog. There are a few examples in the wild that show how to use external tools outside Selenium to solve this problem, but these are not very portable (i.e. platform-specific) and rely on a state of Chrome’s UI, … Read more

Failed to load resource: the server responded with a status of 429 (Too Many Requests) and 404 (Not Found) with ChromeDriver Chrome through Selenium

429 Too Many Requests The HTTP 429 Too Many Requests response status code indicates that the user has sent too many requests in a given amount of time (“rate limiting”). The response representations SHOULD include details explaining the condition, and MAY include a Retry-After header indicating how long to wait before making a new request. … Read more

WebDriverException: Service U:/Scraping/chromedriver.exe unexpectedly exited. Status code was: 1 while working with Chrome and Python

Same error here. My issue was that I had chromedriver.exe on a company sharedrive. Some firewall or security setting was presumably preventing python from accessing the executable file in that remote location. I made chromedriver.exe local and it worked.