1

セレン グリッドをセットアップし、次のコマンドを使用してポート 4441 でハブを実行しています。

java -jar selenium-server-standalone-2.33.0.jar -role ハブ -ポート 4441

次に、次のコマンドを使用してノードも実行しました。

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

それはうまくいったので、テストケース(セレンIDEで作成したもの)を「test.py」というpythonスクリプトとしてエクスポートしました。そのファイルのコードは次のとおりです...

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

このエラーが発生しました: エラー

4

0 に答える 0