我正在尝试编写一些selenium网格(3.0.1)测试并使用VirtualBox Windows VM来测试框架。我可以将集线器连接到同一台机器(Mac或Windows,VM或实际)上的节点,没有任何问题。我还可以将我的Mac连接到一台没有掉线的同事Windows机器。但是,当我将Mac连接到Windows VM(运行VirtualBox时,如果有帮助)。节点每隔30秒左右就会丢弃它的连接。另外,当我登录控制台时,我在节点上看到此错误消息:http://imgur.com/a/Rmwt3。下面是日志片段,以查看连接/重新连接发生的频率。我需要能够设置它,这样我才能在生产中使用它们之前编写测试。谢谢!
13:19:41.978 INFO - Registered a node http://10.0.2.15:5555
13:20:12.001 INFO - Marking the node http://10.0.2.15:5555 as down: cannot reach the node for 2 tries.
13:21:12.063 INFO - Unregistering the node http://10.0.2.15:5555 because it's been down for 60062 milliseconds
13:21:12.063 WARN - Cleaning up stale test sessions on the unregistered node http://10.0.2.15:5555
13:21:12.461 INFO - Registered a node http://10.0.2.15:5555
13:21:42.481 INFO - Marking the node http://10.0.2.15:5555 as down: cannot reach the node for 2 tries
13:22:42.520 INFO - Unregistering the node http://10.0.2.15:5555 because it's been down for 60038 milliseconds
13:22:42.520 WARN - Cleaning up stale test sessions on the unregistered node http://10.0.2.15:5555
13:22:42.945 INFO - Registered a node http://10.0.2.15:5555
答案 0 :(得分:2)
通常情况下,我会研究2天,发布到SO,然后在一小时后找到答案。事实证明,VirtualBox VM的网络适配器已设置为NAT。将其更改为Bridged修复了该问题。去搞清楚。