0

I followed instructions at How to install Google Chrome to install Chrome. For some reasons, my Selenium script was not recognising it. I then installed Chromium and Firefox and the script worked fine. On further debugging, I found the issue is with the install location of these browsers.

Chromium: qa_user@jenkins:/usr/share/chromium-browser

Firefox: qa_user@jenkins:/usr/share/Firefox

enter image description here

Chrome:

enter image description here enter image description here

How can I get Chrome installed in /usr/share/Google-Chrome-Stable like Chromium and Mozilla?

Afsal
  • 161
  • 5

1 Answers1

0

This can be solved by adding the following arguments to the selenium driver

--remote-debugging-port=<port>

For Example,

chromeOptions = webdriver.ChromeOptions() 
chromeOptions.add_experimental_option("prefs", {"profile.managed_default_content_settings.images": 2}) 
chromeOptions.add_argument("--no-sandbox") 
chromeOptions.add_argument("--disable-setuid-sandbox")

chromeOptions.add_argument("--remote-debugging-port=9222") # this

chromeOptions.add_argument("--disable-dev-shm-using") chromeOptions.add_argument("--disable-extensions") chromeOptions.add_argument("--disable-gpu") chromeOptions.add_argument("start-maximized") chromeOptions.add_argument("disable-infobars") chromeOptions.add_argument("user-data-dir=.\cookies\test")

driver = webdriver.Chrome(chrome_options=chromeOptions) driver.get("https://google.com/") driver. Quit()