I am writing an automated test for the browser back button on logout of an angular application using a combination of protractor and cucumberjs.
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)
This points to where I'm calling the history.back(); function.
How do I fix this, or correctly implement a browser back function using cucumber js?
Purpose: The protractor command back() is used to move backward in the browser history. Returns: This command returns a promise that will be resolved when the navigation event has completed.
Protractor is a NodeJS program which is written in JavaScript and runs with Node to identify the web elements in AngularJS applications, and it also uses WebDriver to control the browser with user actions.
In your protractor test:
browser.navigate().back();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With