使用量角器或javascript的浏览器后退按钮 [英] Browser Back Button using protractor or javascript

查看:70
本文介绍了使用量角器或javascript的浏览器后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用量角器和cucumberjs的组合在注销角度应用程序时编写浏览器后退按钮的自动测试。

I am writing an automated test for the browser back button on logout of an angular application using a combination of protractor and cucumberjs.

尝试使用命令时 history.back()我收到以下错误:

When trying to use the command history.back() I get the following error:

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

这指向我正在调用history.back();功能。

This points to where I'm calling the history.back(); function.

如何修复此问题,或使用黄瓜js正确实现浏览器返回功能?

How do I fix this, or correctly implement a browser back function using cucumber js?

推荐答案

在量角器测试中:

browser.navigate().back();

这篇关于使用量角器或javascript的浏览器后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆