[英]How to clear page Session Storage in Nightwatch
In order to test functionality of pop-up I needed to clear browser session storage.为了测试弹出窗口的功能,我需要清除浏览器会话存储。
In this way the pop-up appears again.这样弹窗又出现了。
How can I clear the page Session Storage in Nightwatch?如何清除 Nightwatch 中的会话存储页面?
To clear session stogarage I used Nightwatch execute()
command.为了清除会话存储,我使用了 Nightwatch
execute()
命令。
In the page object function I added command在页面对象函数中我添加了命令
.execute(function() {return window.sessionStorage.clear();})
browser.execute(function() {
return localStorage.clear();
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.