设置Selenium Grid(Setting up Selenium Grid)

编程入门 行业动态 更新时间:2024-10-24 18:24:21
设置Selenium Grid(Setting up Selenium Grid)

我正在设置Selenium Grid服务器,我已经在我的本地机器上成功完成了,我想知道如何给出主机名,所以如果其他测试人员想要注册到集线器他们应该能够做到这一点,这就是我所做的至今:

在我的本地机器上(假设我将允许其他测试人员在这里注册节点)

在我的本地计算机上启动集线器:

java -jar selenium-server-standalone-2.21.0.jar -hub

启动节点

java -jar selenium-server-standalone-2.21.0.jar -role node -hub localhost:4444/grid/register

我查看集线器的状态:localhost:4444 / grid / console

现在,我的问题是:如何从another machine注册?

在我的另一台机器上,我已经下载了selenium-server-standalone jar文件并运行了这个命令

java -jar selenium-server-standalone-2.21.0.jar -role node -hub localhost:4444/grid/register

我得到这个错误:

hub down or not responding

我知道我不应该从其他机器上给localhost这个我很困惑。

I am setting up Selenium Grid server and I have done successfully on my local machine and I'm wondering how to give the hostname so if other tester wants to register to the hub they should be able to do that, here is what I have done so far:

on my local machine (assuming I will be allowing other tester to register the node here)

Starting a Hub on my local machine:

java -jar selenium-server-standalone-2.21.0.jar -hub

Starting a Node

java -jar selenium-server-standalone-2.21.0.jar -role node -hub localhost:4444/grid/register

I view the status of the hub: localhost:4444/grid/console

Now, my question is: How to register from another machine?

on my other machine I have downloaed the selenium-server-standalone jar file and I run this command

java -jar selenium-server-standalone-2.21.0.jar -role node -hub localhost:4444/grid/register

I get this error:

hub down or not responding

I know I should not be giving the localhost from other machine and I'm confused here.

最满意答案

您可以按如下方式启动selenium网格

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

您可以按如下方式启动selenium节点

java -jar selenium-server-standalone-2.21.0.jar -role node -hubHost <<hostname/ip>> -hubPort 4444

而不是字符串<<hostname/ip>> ,给出运行集线器的机器的主机名或IP。 如果节点和集线器都在同一台计算机上,则需要使用localhost或127.0.0.1

You can start the selenium grid as follows

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

You can start the selenium node as follows

java -jar selenium-server-standalone-2.21.0.jar -role node -hubHost <<hostname/ip>> -hubPort 4444

Instead of the string <<hostname/ip>>, give the hostname or ip of the machine where hub is running. If both the node & hub are in same machine, you need to use localhost or 127.0.0.1

更多推荐

本文发布于:2023-08-07 03:53:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1460027.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:Selenium   Grid   Setting

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!