机器人框架:在测试之间重用现有的浏览器窗口

the*_*ror 5 selenium robotframework selenium-webdriver

我想使用 运行测试,然后使用第一次打开的同一浏览器窗口pybot运行更多测试。pybotpybot

\n\n

所以\xe2\x80\xa6

\n\n
pybot test1.txt\n#opens browser window and runs test1.txt and doesn't close the window\n#pybot completes execution\npybot test2.txt\n#uses the same browser window from test1\n#pybot completes execution\npybot test3.txt\n#uses the same browser window from test1\n#pybot completes execution    \n
Run Code Online (Sandbox Code Playgroud)\n\n

无法弄清楚如何做到这一点\xe2\x80\xa6。

\n\n

我在第一个测试中尝试过Open Browser www.mysite.com alias=1,然后Switch Browser 1在其他测试中尝试过,但他们只是出错了No browser is open

\n

dmr*_*dmr 0

实际上这是绝对可能的,但是你必须在测试套件中组织测试 testsuites/ __init__.robot test1.robot test2.robot test3.robot

您必须__init__.robot在套件设置中打开浏览器并在套件拆解中销毁它

*** Settings ***
Suite Setup   Open Browser
Suite Teardown    Close Browser
Run Code Online (Sandbox Code Playgroud)

并运行测试pybot ./testsuites