Testing definitions with the Hit Tester

 

Yet another powerful feature of the BrowserHawk Editor is the advanced Hit Tester. The Hit Tester provides you with the ability to test expected user agent strings to confirm that the browser object that the BrowserHawk ActiveX component will return as a match is what you expect.

 

In addition, the Hit Tester also provides a view of all properties values that will be set based on the specific user agent. These values include the results from any properties which are overridden as a result of applicable filters. For example, finding the browser definition for Internet Explorer version 4 and looking at its properties in the Editor shows its default settings – before any filters are applied. Since variations in user agents affect how filters are applied, using the Hit Tester provides the insight you will need to create and debug browser definitions.

 

Sample Hit Tester output for Netscape v4.04 for Windows NT:

 

image\hittest_shg.gif

 

Tip: Viewing the assigned property values for a particular browser in the Folder/Browser Window Pane does not necessarily show you what properties will be set for a particular user agent. This is because multiple user agents may match that same browser, and as a result of filters, some properties may take on new values. Using the Hit Tester easily shows you what the exact property values will be for a specific user agent.

To test a particular user agent, load the Hit Tester as follows:

image\DO-IT.gif Select Hit Tester from the View menu.

 

Then enter the user agent you wish to check and press the Test button. You will then see the results, including a title showing the browser description, as well as the user agent search string you have defined for that browser. You will also notice that the main BrowserHawk screen underneath the Hit Test window automatically selects the matching browser. This makes it easy for you to quickly make any modifications to that browser which you're testing if necessary.

 

If you type a user agent into the Hit Tester that has not already been entered, it is stored in the combo box for future use. You can then click on the combo box drop down arrow to select the user agent, should you wish to use it again. In addition the hit tester provides you with the ability to import user agents from a text file so you can test them interactively. The file containing the user agents must be an ASCII text file with each user agent on a separate line (CR/LF delimited).

 

Note: The Hit Tester feature is only available in the Professional and Enterprise Editions of BrowserHawk.

 

See Also:

Working with browsers

How the visiting browser is identified

Working with properties

Working with filters

Working with folders