How do you connect remotely using Python + Webdriver

前端 未结 2 1746
陌清茗
陌清茗 2021-01-01 02:41

I am trying to figure out how to connect to my remote webdriver instance.

This is the code I am currently using:

from selenium.remote.webdriver impor         


        
2条回答
  •  星月不相逢
    2021-01-01 03:19

    You need to ensure selenium server hub and node are set up before the test. Please refer to this.

    Example on hub run

    java -jar selenium-server-standalone-2.5.0.jar -role hub
    

    Example on node to connect to hub ,run

    java -jar selenium-server-standalone-2.5.0.jar -role webdriver -hub
       http://localhost:4444/grid/register -port 5555
    

    You can have as many nodes as you want.

提交回复
热议问题