1. <tfoot id='rrEpu'></tfoot>

      <i id='rrEpu'><tr id='rrEpu'><dt id='rrEpu'><q id='rrEpu'><span id='rrEpu'><b id='rrEpu'><form id='rrEpu'><ins id='rrEpu'></ins><ul id='rrEpu'></ul><sub id='rrEpu'></sub></form><legend id='rrEpu'></legend><bdo id='rrEpu'><pre id='rrEpu'><center id='rrEpu'></center></pre></bdo></b><th id='rrEpu'></th></span></q></dt></tr></i><div id='rrEpu'><tfoot id='rrEpu'></tfoot><dl id='rrEpu'><fieldset id='rrEpu'></fieldset></dl></div>
      <legend id='rrEpu'><style id='rrEpu'><dir id='rrEpu'><q id='rrEpu'></q></dir></style></legend>

          <bdo id='rrEpu'></bdo><ul id='rrEpu'></ul>

      1. <small id='rrEpu'></small><noframes id='rrEpu'>

      2. selenium 网格监听节点端口而不是集线器端口

        时间:2023-07-04
        <tfoot id='qwqoV'></tfoot>

          • <bdo id='qwqoV'></bdo><ul id='qwqoV'></ul>

              <small id='qwqoV'></small><noframes id='qwqoV'>

                  <tbody id='qwqoV'></tbody>
                <legend id='qwqoV'><style id='qwqoV'><dir id='qwqoV'><q id='qwqoV'></q></dir></style></legend>
              • <i id='qwqoV'><tr id='qwqoV'><dt id='qwqoV'><q id='qwqoV'><span id='qwqoV'><b id='qwqoV'><form id='qwqoV'><ins id='qwqoV'></ins><ul id='qwqoV'></ul><sub id='qwqoV'></sub></form><legend id='qwqoV'></legend><bdo id='qwqoV'><pre id='qwqoV'><center id='qwqoV'></center></pre></bdo></b><th id='qwqoV'></th></span></q></dt></tr></i><div id='qwqoV'><tfoot id='qwqoV'></tfoot><dl id='qwqoV'><fieldset id='qwqoV'></fieldset></dl></div>

                • 本文介绍了selenium 网格监听节点端口而不是集线器端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  对于我的测试,我在不同的端口上本地运行网格和节点.

                  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-server.jar -role node -hub http://127.0.0.1:4444/grid/register -port 5556
                  

                  因此,网格在 4444 上运行,节点在 5556 上运行.

                  So, the grid is running on 4444 and node is running on 5556.

                  在我的测试中,如果我启动驱动程序

                  In my test, if i start the driver as

                  driver = webdriver.Remote(command_executor='http://127.0.0.1:4444/wd/hub', desired_capabilities=desired_capabilities)
                  

                  那么测试失败并出现异常

                  then the test fails with the exception

                  response = {'status': 500, 'value': '{"status":13,"value":{"class":"java.lang.NullPointerException","stackTrace":[{"fileName":"Ha...n","lineNumber":590},{"fileName":"Thread.java","className":"java.lang.Thread","methodName":"run","lineNumber":745}]}}'}
                  

                  如果我在节点端口 5555 而不是集线器端口 4444 上运行测试,则测试通过,如下所示

                  The test passed if i run the test on the node port 5555, instead of the hub port 4444, as shown below

                  driver = webdriver.Remote(command_executor='http://127.0.0.1:5555/wd/hub', desired_capabilities=desired_capabilities)
                  

                  我认为,我们应该在集线器端口上运行测试,在本例中是 4444 而不是 5555.

                  I was of the opinion that, we should be running the tests on the hub port, which in this case is 4444 and not 5555.

                  如果我错了,请纠正我.

                  Please correct me if i am wrong.

                  推荐答案

                  如果你打算在Grid中使用Selenium配置通过HubNode配置,我建议你使用最新的selenium-server-standalone-3.6.0 jar如下:

                  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. 启动 Selenium Grid Hub(默认在端口 4444):

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

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

                • 确认 Selenium Grid Hub 已启动:

                • 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
                  

                • 访问 Selenium Grid Hub 控制台 并确保 Selenium Grid Hub 已启动并运行:

                • Access the Selenium Grid Hub Console and ensure Selenium Grid Hub is up and running:

                  http://localhost:4444/grid/console
                  

                • 为 Mozilla/GeckoDriver 启动 Selenium Grid Node(默认在端口 5555):

                • 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
                  

                • 确认Selenium Grid Node已注册并启动:

                • 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
                  

                • 使用 DesiredCapabilities 执行 Testcase,如下所示:

                • 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)
                  

                • 在您的 Testcase 成功执行时,观察以以下结尾的控制台日志:

                • 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
                  

                • 这篇关于selenium 网格监听节点端口而不是集线器端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何让 Selenium Web 驱动程序等待元素可访问,而不仅仅是存在? 下一篇:__init__() 接受 2 个位置参数,但使用 WebDriverWait 和 expected_condition

                  相关文章

                  • <bdo id='Ka8v4'></bdo><ul id='Ka8v4'></ul>

                      <tfoot id='Ka8v4'></tfoot>

                    1. <legend id='Ka8v4'><style id='Ka8v4'><dir id='Ka8v4'><q id='Ka8v4'></q></dir></style></legend>

                      <small id='Ka8v4'></small><noframes id='Ka8v4'>

                      <i id='Ka8v4'><tr id='Ka8v4'><dt id='Ka8v4'><q id='Ka8v4'><span id='Ka8v4'><b id='Ka8v4'><form id='Ka8v4'><ins id='Ka8v4'></ins><ul id='Ka8v4'></ul><sub id='Ka8v4'></sub></form><legend id='Ka8v4'></legend><bdo id='Ka8v4'><pre id='Ka8v4'><center id='Ka8v4'></center></pre></bdo></b><th id='Ka8v4'></th></span></q></dt></tr></i><div id='Ka8v4'><tfoot id='Ka8v4'></tfoot><dl id='Ka8v4'><fieldset id='Ka8v4'></fieldset></dl></div>