简体   繁体   English

防止在@After之后关闭浏览器

[英]Prevent to close browser after @After

I am trying to prevent browser to close after my test scenario, I have tried several things found from online resources but nothing worked so far. 我试图在我的测试方案后阻止浏览器关闭,我已经尝试了一些从在线资源中找到的东西,但到目前为止没有任何效果。

The goal is to prevent the browser to get closed and keep manually from a certain point, like a 'checkpoint', is there any way to do this? 目的是防止浏览器关闭并手动从某个点(例如“检查点”)进行维护,是否有任何方法可以这样做?

I have tried : 我努力了 :

@After("@leave_window_open")

but seems it is working only if the Scenario is failing. 但似乎只有在方案失败时它才起作用。

is there any simple way to block this behavior, and avoiding debugging? 有没有简单的方法来阻止此行为,并避免调试?

The browser won't close unless you call .close() or .quit() . 除非您调用.close().quit()否则浏览器不会关闭。 You must have those calls somewhere... just remove them. 您必须将这些呼叫放在某处...只需将其删除即可。 If you are looking for a intermittent fix, just add a breakpoint where you want the script to stop. 如果您正在寻找间歇性修复程序,只需在希望脚本停止的位置添加一个断点即可。 Once the run breaks, stop the execution and continue manually. 运行中断后,请停止执行并手动继续。 I do this all the time for debugging purposes. 我一直在进行调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM