Only local connections are allowed Chrome and Selenium webdriver

前端 未结 12 1683
误落风尘
误落风尘 2020-11-30 05:59

I am using Chrome webdriver 2.23 & Selenium 2.53.1. I have tried a lot, but could not get it fixed. Whenever I run my selenium script, it is giving me the following err

12条回答
  •  执念已碎
    2020-11-30 06:17

    You need to pass --whitelisted-ips= into chrome driver (not chrome!). If you use ChromeDriver locally/directly (not using RemoteWebDriver) from code, it shouldn't be your problem.

    If you use it remotely (eg. selenium hub/grid) you need to set system property when node starts, like in command:

    java -Dwebdriver.chrome.whitelistedIps= testClass etc...
    

    or docker by passing JAVA_OPTS env

      chrome:
        image: selenium/node-chrome:3.141.59
        container_name: chrome
        depends_on:
          - selenium-hub
        environment:
          - HUB_HOST=selenium-hub
          - HUB_PORT=4444
          - JAVA_OPTS=-Dwebdriver.chrome.whitelistedIps=
    

提交回复
热议问题