在 Robot 框架中使用已经打开的浏览器窗口 [英] Using already opened Browser window in Robot framework
问题描述
我们正在使用 Robot Framework 编写/自动化验收测试用例.
We are using Robot Framework for writing/automating acceptance test cases.
每次我需要运行整个脚本来检查我脚本的最后几行代码时,这会浪费大量时间并在系统中创建大量重复记录,我只是想避免重新运行整个脚本来检查最后几行代码,并从上次运行出错的地方继续执行.
Every time i need to run the whole script to check the last lines of code of my script, That Wastes lot of time and creates lots of duplicate records in the system, i just wanted to avoid re-running whole script to check last lines of code and resume the execution from the point where it erred in previous run.
也就是说;如果测试运行抛出错误;它不仅会关闭浏览器窗口;下一次运行将使用相同的浏览器窗口和下一个命令,之后它在上次运行中失败.
That is to say;If the test run throws error; it will not just close the browser window; And next run will use the same browser window with next command in sequence after which it had failed in last run.
推荐答案
Robot/Selenium 不能直接实现您的要求,但从您写的内容来看,我可以看到一些改进的空间:
What you ask is not directly possible with Robot/Selenium, but from what you write, I can see room for some improvements:
- 在系统中创建大量重复记录" => 您应该在测试中使用 Teardown,以便在测试完成后清理系统(即使出现故障也会运行拆卸).因此,下次运行测试时,系统会干净地启动
- 这浪费了很多时间" => 如果您的测试太长而无法运行,也许您应该考虑将它们分成更小的块.还可以考虑直接通过 REST 或 SOAP 接口而不是浏览器运行部分测试.
这篇关于在 Robot 框架中使用已经打开的浏览器窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!