How to build remote Webdriver for Chrome

后端 未结 4 1336
故里飘歌
故里飘歌 2021-02-06 03:34

I am trying to run my Selenium tests against Chrome. When I initialize driver locally:

@driver = Selenium::WebDriver.for( :chrome )

Everything

4条回答
  •  野性不改
    2021-02-06 04:28

    Okay, guys. With the help I could find the answer. Check it out.

    That is how you set up the driver on your local machine:

        @driver = Selenium::WebDriver.for(:remote, :chrome :url => 'http://' + SELENIUM_HOST + port + webdriver_hub, :desired_capabilities => browser)
    

    where

    browser = ':chrome'
    port = ':4444'
    webdriver_hub = '/wd/hub'
    

    On the remote machine running the server would be something like this

        java -jar selenium-server-standalone-2.2.0.jar -Dwebdriver.chrome.driver="path/to/where/you/put/chromedriver.exe"
    

    After run your tests from the local machine.

    Best of luck!

提交回复
热议问题