简体   繁体   English

使用量角器或javascript的浏览器后退按钮

[英]Browser Back Button using protractor or javascript

I am writing an automated test for the browser back button on logout of an angular application using a combination of protractor and cucumberjs. 我正在使用量角器和cucumberjs的组合在注销角度应用程序时编写浏览器后退按钮的自动测试。

When trying to use the command history.back() I get the following error: 当尝试使用命令history.back()我收到以下错误:

 ReferenceError: history is not defined
        at World.<anonymous> (/Users/&&&&&/&&&&&/features/step_definitions/browsers.js:62:16)

This points to where I'm calling the history.back(); 这指向我正在调用history.back(); function. 功能。

How do I fix this, or correctly implement a browser back function using cucumber js? 我如何解决这个问题,或者使用黄瓜js正确实现浏览器后退功能?

在你的量角器测试中:

browser.navigate().back();

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

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