我已经设置了我的selenium网格,我使用此命令在端口4441上运行了一个集线器:

java -jar selenium-server-standalone-2.33.0.jar -role hub -port 4441

然后我使用此命令运行我的节点:

java -jar selenium-server-standalone-2.33.0.jar -role node -hub http://localhost:4441/grid/register -maxSession 20 -port 5555

那很好,然后我将我的测试用例(我在selenium IDE中制作)导出为python脚本,名为“test.py” . 这是该文件的代码......

from selenium import selenium
import unittest, time, re

class Exec_dashboard_test(unittest.TestCase):
    def setUp(self):
        self.verificationErrors = []
        self.selenium = selenium("localhost", 4441, "*chrome", "http://localhost:8080/rootpage")
        self.selenium.start()

    def test_exec_dashboard_test(self):
        sel = self.selenium
        sel.open("/risksense/login")
        sel.type("id=username_or_email", "joeTest")
        sel.type("id=password", "test")
        sel.click("id=loginButton")
        sel.wait_for_page_to_load("30000")
        sel.open("/risksense/")
        sel.click("css=div.module-text")
        sel.click("css=#submodule-4 > a")
        time.sleep(6)
        sel.double_click("css=path")
        sel.click("//div[@id='popup']/div/div[2]/button[2]")
        sel.double_click("css=rect.bar")
        sel.click("//div[@id='popup']/div/div[2]/button[2]")

    def tearDown(self):
        self.selenium.stop()
        self.assertEqual([], self.verificationErrors)

if __name__ == "__main__":
    unittest.main()

最后,我尝试使用以下命令运行python脚本:

python test.py

我收到此错误:
Error