0
votes

When I run my Python-Selenium test with Eclipse it works. If I add the Python test as batch file in Jenkins I always get this error:

selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

I set the path for Python in windows correctly. Can anyone help, please. Thank you.

I set the path like this: self.driver = webdriver.Chrome("C://Selenium-driver//chromedriver.exe")

 pts = webdriver.ChromeOptions()
 opts.binary_location = ("C://Users//me//AppData//Local//Google //Chrome//Application//chrome.exe")
 driver = webdriver.Chrome(chrome_options = opts)

I run the batch file like this in Jenkins with an Execute Windows batch command: call "c:\myfolder\login_python2.bat"

The batch file is:

@echo off
cd C:\Users\me\AppData\Local\Programs\Python\Python36\ 
python C:\Users\me\NEON\workspace\Test1\test-package\test.py
1
where is jenkins server running ?? in your system or remote ? - Renjith Thankachan
jenkins is running in my system in local - 20marslog g
does anyone need more details? i have no reply for this thread. and still stucked even after hours and hours searching in internet. something is missing in my set-up. - 20marslog g
Is Jenkins running as your user account? If not it might not have permissions to access Chrome at that path. Also, you don't need double slashes when they're forward slashes, nor do you need slashes after the space. - Mark Lapierre
jenkins is running with a user a created when installing jenkins, ok for the double slash, notes. Jenkins is not running with my windows user account. - 20marslog g

1 Answers

0
votes

Make sure you install your Chrome in C:\Program Files\

By default it will install itself in the Appdata folder. Try to re-install Chrome with a standalone Chrome installer.