Browser History Navigation

Last edited on


Squish is able to navigate through the browser history as if the user would have clicked the browser buttons Back or Forward.

While those buttons are not part of the web application's DOM tree, it might be possible to simply record clicks on those buttons depending on the Squish editions that are covered by the license and the specific Browser (e.g. with a Squish for Web+Windows license and using Microsoft Internet Explorer). On the other hand, this is not the recommended approach, as it won't work for pure Squish for Web license holders and creates a test script that depends on the browser.

To avoid this and to create a cross-browser script, one can access the JavaScript history object through the window object that displays the DOM tree of the web application. To access the browser's JavaScript interpreter, Squish provides a function called evalJS(code); .

To load the previous URL, simply add the following statement to your test script:


To navigate forward, execute this statement:


Or use the method history.go(number) to load another URL back in the timeline: