selenium grid listening on node port instead of hub port

后端 未结 3 1703
离开以前
离开以前 2020-12-20 07:30

For my test, I am running grid and node locally on different ports.

java -jar /usr/bin/selenium-server.jar -port 4444 -role hub
java -jar /usr/bin/selenium-s         


        
3条回答
  •  无人及你
    2020-12-20 07:56

    If you intend to use Selenium in Grid configuration through Hub and Node configuration, I would suggest you to use the most recent selenium-server-standalone-3.6.0 jar as follows:

    1. Start the Selenium Grid Hub (by default on port 4444) :

      java -jar selenium-server-standalone-3.6.0.jar -role hub
      
    2. Confirm the Selenium Grid Hub is started:

      16:06:29.891 INFO - Nodes should register to http://192.168.1.48:4444/grid/register/
      16:06:29.891 INFO - Selenium Grid hub is up and running
      
    3. Access the Selenium Grid Hub Console and ensure Selenium Grid Hub is up and running:

      http://localhost:4444/grid/console
      
    4. Start the Selenium Grid Node (by default on port 5555) for Mozilla/GeckoDriver:

      java -Dwebdriver.gecko.driver=geckodriver.exe -jar selenium-server-standalone-3.6.0.jar -role node -hub http://localhost:4444/grid/register
      
    5. Confirm the Selenium Grid Node is registered and started:

      16:15:54.696 INFO - Selenium Grid node is up and ready to register to the hub
      16:15:54.742 INFO - Starting auto registration thread. Will try to register every 5000 ms.
      16:15:54.742 INFO - Registering the node to the hub: http://localhost:4444/grid/register
      16:15:54.975 INFO - The node is registered to the hub and ready to use
      
    6. Execute with the Testcase with DesiredCapabilities as follows:

      self.driver = webdriver.Remote(command_executor='http://127.0.0.1:4444/wd/hub', desired_capabilities=caps)
      
    7. Observe the console logs ending with the following on successful execution of your Testcase:

      16:23:50.590 INFO - Found handler: org.openqa.selenium.remote.server.ServicedSession@37ff9771
      16:23:50.590 INFO - Handler thread for session 31a1dcb0-8bed-40fb-acdb-d5be19f03ba2 (firefox): Executing DELETE on /session/31a1dcb0-8bed-40fb-acdb-d5be19f03ba2
       (handler: ServicedSession)
      1506941630595   Marionette      INFO    New connections will no longer be accepted
      

提交回复
热议问题