Navigations are a kind of item in Badboy that records clicks or activation of user interface elements in the browser window. When you record a navigation, it finds the browser element that was clicked on (or navigated in another way, for example, by hitting space or enter) and remembers it. When you play back, Badboy finds the same element again and simulates a click on it again so that the browser performs the same navigation again.
By default, Badboy records Requests instead of Navigations. However you can easily switch recording modes at any time to record Navigations instead. You can do this by the following methods:
Badboy will record different kinds of Navigation Item in your script depending on what kind of element you click on and also how that element is represented in the page you are recording. The table below shows the three different kinds of item you will see:
|Represents a click on a link. This may be any kind of link including an image link or other non-textual content.|
|A click on a button. These are usually buttons in forms such as Submit buttons.|
Web pages can often change quite significantly in their layout, size and shape, and can often have many elements that look or appear the same. Because of this, Badboy uses several different ways of identifying elements in order to ensure that it finds the correct one that you originally recorded when playing back. The information that Badboy uses to identify the element is called the "Reference" to the element. When you record a click on an element, Badboy uses the following logic to find a reference for it:
If you wish you can open the properties of the Navigation and set the reference information yourself. The figure below shows how the properties dialog looks:
The following table describes the different properties you can set:
|Element Reference||This identifies the element to be navigated. How this text is interpreted depends on the Reference Type.|
|Element Type||Determines how the reference text is used.
|Element Filter||Sets the kind of elements that should be considered for matching the reference text. This helps make sure Badboy chooses the correct element by screening out all elements that do not match the filter. You can choose "Links", "Buttons" or "All Elements"|
|Index||Causes Badboy to use the specified occurrence of the matched element on the page. For example, if there are three buttons named 'Logout' on the page, you can make Badboy use the third one by specifying "2" in the Index property. Note that this property is "zero-based", so the first occurrence (the default) is specified using "0" and the second is specified using "1" and so on.|
|Use Regex Match||Causes the Navigation to treat the Reference as a regular expression when attempting to match elements on the page. This is useful if the element you wish to navigation changes for each playback but has a definable form that you can describe with a regular expression. This option only applies to the "Visible Text Reference" reference type.|
If you are having problems getting your navigation to locate the right element you can right click on the Navigation and choose "Highlight Element" to show which element on the page will be targeted. If it targets the wrong one then you can increment the "Index" option in the properties to cause it to find the next item in the page until it finds the correct element.
When pages contain fields that allow the user to enter information you will usually want any changes that are made to the fields to also be made when your Navigations are played back. For this reason, Badboy automatically records Form Populators for you to set any changed fields on forms on the page. Note that Badboy will only record a Form Populator if one of the forms on the page has been changed from it's state when the page was first loaded.
Badboy supports two types of Navigation: Passive and Active.
When Navigations are recorded, Badboy automatically notices whether there was a page load and sets the "Passive Navigation" option for you.
See the topic Recording Modes for more information about Navigations and how Badboy's recording of them works.