Skip to main content
Version: 10.2.4

Automate browser navigation commands

TypeMethodDescription
voidback()
  • Browser: Move back a single item in the browser's history.
  • Desktop: Move back to the preview window in the desktop driver history.
voidforward()
  • Browser: Move a single item forward in the browser's history. Does nothing if you are on the latest page viewed.
  • Desktop: Move forward to the next window in the desktop driver history.
void
  • driver().navigate().to(java.lang.String url)
  • driver().navigate().to(java.net.URL url)
  • Browser: Load a new web page in the current browser window. This is done using an HTTP GET operation, and the method blocks until the load is complete. This follows redirects issued either by the server or as a meta-redirect from within the returned HTML. Should a meta-redirect rest for any duration of time, it is best to wait until the timeout is over, since the underlying page should change while your test is executing the results of future calls against this interface will be against the freshly loaded page.
  • Desktop: Run a program.
voidrefresh()
  • Browser: Refresh the current page.
  • Desktop: Empty the implementation.

The sample below:

  1. Opens the documentation main page.
  2. Navigates to a new page by clicking a link.
  3. Navigates back to the documentation main page.
  4. Navigates forward to the Release Notes page.
  5. Opens the Wikipedia website in the current tab.
  6. Refreshes the current page.
Expand to view code
<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://web-harvest.sourceforge.net/schema/1.0/config"
scriptlang="groovy">

<robotics-flow>
<robot name="r2d2" driver="internet explorer" close-on-completion="true" start-in-private="true">
<script><![CDATA[
timeouts(40 * 1000)
open('https://doc.workfusion.com/express/docs/iac-express/core/overview.html')

$(byPartialLinkText('Notes')).click()
sleep(2000)

back()
sleep(2000)

forward()
sleep(2000)

driver().navigate().to('wikipedia.org')
sleep(2000)

refresh()
sleep(2000)

]]></script>
</robot>
</robotics-flow>
<export include-original-data="false" />
</config>