0

I want to run the selenium test cases in the remote machine. These are the steps I have followed:

Steps I did in server machine:

  1. I have downloaded selenium-server-standalone-3.9.1.jar + Chrome Driver & placed it in a folder and added it to $PATH environmental variable.

  2. I have started selenium server using java -jar selenium-server-standalone-3.9.1.jar -role hub in the Terminal.

Steps I did in local machine:

  1. I have installed selenium-webdriver & selenium-server-standalone-3.9.1.jar

  2. I wrote a sample testcase using selenium webdriver.

  3. I have started a node here using command java -jar selenium-server-standalone-3.9.1.ja-role node -hub http://172.24.111.70:4444/grid/register in the terminal. The node got connected to the hub.

  4. I run the command node test.js in the terminal. I expect the chrome instance to open in the remote machine. But it is running in the local machine.

Screenshots: Hub:(Remote) Terminal Remote Machine Node:(Local) Terminal in Local Machine

Can you please explain me the mistake I have did here? Have I understood the concept wrong?

4

2 回答 2

0

将运行您的测试的 Web 浏览器实例将在节点而不是集线器上创建。集线器是您可以注册多个节点的方式,以便您可以在不同的机器/节点之间分散负载。据我所知,您在连接本地节点的远程机器上有一个集线器。

我认为你想要的也是在远程机器上运行节点,注册到同一台机器上的集线器(注册节点时你可能必须将集线器的 IP 地址更改为 localhost)。

于 2018-02-08T10:16:27.150 回答
0

所以,问题是您希望测试在远程机器上运行,但它们在本地运行?

从它的声音来看,您已经正确完成了所有设置,并且集线器/节点应该可以正常工作。你需要做的,不是从本地机器上运行节点,而是从远程机器上运行它。您只需将 Hub 视为主管,将工作交给节点(他们的员工)去做。Hub 本身不运行任何测试,它只是将数据发送到节点并在多个节点之间进行负载平衡。

我们设置了 6 台远程机器。机器 1 有 Hub 和一个节点,其他 5 台有节点。在我们的项目中,我们指向 Hub,所以当测试运行时,它们会被发送到那里。集线器完成其余的工作(取决于 nodecfg 文件和您在那里的设置)

于 2018-02-08T10:58:24.120 回答