WebDriverException: Message: 'Can not connect to the ChromeDriver'. Error in utils.is_connectable(self.port):

后端 未结 5 1575
情深已故
情深已故 2020-12-06 13:16

I am trying to use the chromedriver 2.10 to run my tests on Chrome Browser Version 35.0.1916.114 On CentOS machine

/home/varunm/EC_WTF_0.4.10/EC_WTF

相关标签:
5条回答
  • 2020-12-06 13:28

    Verify the line 127.0.0.1 localhost is added to your /etc/hosts file and uncommented. This was the issue for some of my colleagues, and I was able to reproduce it after I've removed this line. Adding it back solved the problem.

    0 讨论(0)
  • 2020-12-06 13:29
    Confirm that your chrome version matches.
    If you are using Chrome version 73, please download ChromeDriver 73.0.3683.20
    If you are using Chrome version 72, please download ChromeDriver 2.46 or ChromeDriver 72.0.3626.69
    If you are using Chrome version 71, please download ChromeDriver 2.46 or ChromeDriver 71.0.3578.137
    

    Download: http://chromedriver.chromium.org/downloads

    0 讨论(0)
  • 2020-12-06 13:41


    For Linux

    1. Check you have installed latest version of chrome brwoser-> "chromium-browser -version"
    2. If not, install latest version of chrome "sudo apt-get install chromium-browser"
    3. get appropriate version of chrome driver from following link http://chromedriver.storage.googleapis.com/index.html
    4. Unzip the chromedriver.zip
    5. Move the file to /usr/bin/ directory sudo mv chromedriver /usr/bin/
    6. Goto /usr/bin/ directory and you would need to run something like "chmod a+x chromedriver" to mark it executable.
    7. finally you can execute the code.

    import os
    from selenium import webdriver
    from pyvirtualdisplay import Display
    display = Display(visible=0, size=(800, 600))
    display.start()
    driver = webdriver.Chrome()
    driver.get("http://www.google.com")
    print driver.page_source.encode('utf-8')
    driver.quit()
    display.stop()
    
    0 讨论(0)
  • 2020-12-06 13:41

    open /etc/hosts file and check 127.0.0.1 localhost have matched

    0 讨论(0)
  • 2020-12-06 13:43

    This usually means that you are not using the latest ChromeDriver. For that, navigate to https://sites.google.com/a/chromium.org/chromedriver/.

    0 讨论(0)
提交回复
热议问题