0

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
Renjith Thankachan
  • 4,178
  • 1
  • 30
  • 47
  • where is jenkins server running ?? in your system or remote ? – Renjith Thankachan Apr 27 '17 at 15:30
  • jenkins is running in my system in local – 20marslog g Apr 27 '17 at 17:23
  • 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 Apr 27 '17 at 18:08
  • 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 Apr 27 '17 at 19:03
  • 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 Apr 27 '17 at 19:44
  • @20marslogg any windows power user can help you, so added more relevent tags to the question, the easy way to solve the problem is changing jenkins windows service properties from control panel login as admin user. Hope some power user will answer the question in more details. – Renjith Thankachan Apr 28 '17 at 04:07
  • @I Am Batman thanks will check – 20marslog g Apr 28 '17 at 12:58
  • instead to add the path calling python, why don't you add to your windows paths variable? I solved many problem in this way – Carlo 1585 Sep 29 '17 at 11:08

1 Answers1

0

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.

SiHa
  • 7,830
  • 13
  • 34
  • 43
Hariprasad
  • 73
  • 2
  • 6