Open Chrome Browser keyword fails when Chrome is already open

I am using the Open Chrome Browser keyword because it is the only keyword I could get the prompt_for_download argument to work for.

I’ve noticed that if I close Chrome before I run my bot that it works without fail. I know that I could add logic to close all Chrome instances before the process runs or when failures occur but I am worried that this could still cause unexpected errors.

Above is the keyword I am using with my arguments, it’s nothing special.

Above is the error message that shows when I have Chrome already open in another browser or multiple browsers.

Chrome will open up at the Google home page and then fail out with that ambiguous message if any other instances of Chrome are open.

Even if you have a Chrome browser instance already running (like the browser you normally use under your profile), the Open Available Browser with a browser_selection=chrome should still not fail.

Most probably that’s because you’re passing an unexpected options value, which currently that should be one of the following:

  • A ChromeOptions instance
  • Or a string chaining calls like add_argument(...);set_capability(..., ...)
  • Dictionary having keys like arguments, capabilities, binary_location

From keyword’s documentation:

WebDriver creation can be customized with options. This accepts a class
instance (e.g. ChromeOptions), a string like
add_argument("--incognito");set_capability("acceptInsecureCerts", True) or
even a simple dictionary like:
{"arguments": ["--incognito"], "capabilities": {"acceptInsecureCerts": True}}