Simulated Browser
A simulated browser is a windows application that can connect to an IE Browser on the system and display the DOM contents of that IE window in a different view. The three different views that are supported are:
Simulated IE
Treeview
WET Simulation
The simulated IE view looks similar to an IE browser, but the operations can not be performed directly as in IE . In the Treeview, the DOM structure of the actual page which is shown o
n the real IE browser is reconstructed and represented in the form of a treeview. The last mode is a view that WET constructs entirely from scratch, based on the DOM structure of the actual IE page.
The IE Simulated browser may not be accurate for some applications and may have some distortion in it. The WET simulated browser is constructed entirely from scratch and therefore the view is not the same as the real browser. The Wet treeview represents the DOM structure in a hierarchical tree and therefore is the most accurate in terms of capturing information about the objects itself. We recommend the WET Treeview as the best simulation mode to create accurate WET scripts.
Since the functionality of all the 3 modes are by-and-large, the same, only one of the modes will be used to describe the features. However, the unique functionality of each of the modes (if any) will be detailed out.
Simulated IE
A simulated IE is a windows application that looks similar to an IE browser. However the simulated browser can be used to navigate to web sites directly using launch browser and also sync with opened IE. The tester cannot perform any operation directly in the simulated browser. Instead a context sensitive pop up menu is provided using which the tester 'instructs' that certain operations must be performed. These 'instructions' are used to generate scripts and create object depots.
When to use the simulated IE mode : If the simulated IE mode works well for your application, then it is the best mode to use. The speed of rendering in a simulated IE is slow when compared to the Wet Treeview.
Connecting to IE Browsers :
Navigating to a web site using simulated IE can be done using browser options given in simulated IE .
If a web site is already opened in IE and want to test for that site then can use sync with opened IE .
If you want to navigate to a web site which is not opened then can use launch browser option.
When a launch browser option is clicked then a navigate box is obtained then type the url and click on go.
IE is opened for the given url and an exact replica of the opened IE is shown in simulated IE after few seconds.
Associating script editor and object depot:
The primary reason for using a simulated browser is to be able to create WET scripts and object depots for the application test. To be able to do this, the script editor and the object depot has to be associated with the simulated browser. The scripts will be recorded to the script editor only if the editor is been associated with the simulated IE. To associate the editor open the editor present in wet manager and then go to associate -> editor. A function dialog box is opened , select the opened editor from the list and click on add .
Please note that only those script editors that have been opened through the wet manager will be displayed as choices in the drop-down boxes.
On the same lines, to use the object depot while working with simulated IE associate the opened opened depot object using associate -> object depot. This will then allow the user actions on the simulated browser to be converted to object depots.
View Menu :
Recompute dom is the only option in the view menu that is applicable to a simulated IE. It is used to recompute the dom tree. In most of the cases, you will not need this option. But for some applications, you may find that even though the page simulated view has been created, right clicking on the objects either does not show anything at all or displays incorrect value. In such a case, you could try to recompute the DOM view after waiting for a few seconds.
Performing operations on the Simulated IE:
Once the simulated view has been created by either syncing to an IE browser or launching a new browser, then a tester can perform operations on this view and generate scripts / object depot.
In IE all the operation is done directly example to add value to the text field should type the value by selecting the text field and to click on button take the mouse on the button and then left click on it.
But the working on simulatedie is different , here instead of direct working all the operations are done using right clicking on the object which will display the context menu from that select the operation to be performed.
Example to add the browser to the object depot right click on title context menu is obtained as below:
click on 'Add object to depot' option the object gets added to the object depot as below :
Now again right click on browser title and then click on 'Add Placeholder' option the script for the browser gets added to the associated script editor as below :
The same method can be used to generate blank scripts for buttons, text fields etc.
To add the script for test field right click on the text field context menu will be displayed as below:
Now click on 'Add Placeholder' option the script gets added to the script editor as below:
If the text field object was not present in object depot before the add placeholder operation is done then the text field gets added to object depot as below:
To perform any operations right click on that object object context menu is obtained then select the operation to be performed. Context menu is different depending on the type of the object been selected.
Context menu for text field is as below :
when the cursor is placed on text field tool tip with the properties of the text field is shown as below ;
Refer to API guide for the more information of using all the options of the context menu.
Context menu for the button along with the tool tip showing properties for the button is as below :
context menu for text area along with the properties in tool tip is as below :
context menu for Link along with the tool tip to display the its properties is as below :
context menu for the radio button is as below :
context menu for check box is as below :
context menu for list/check box is as below :
context menu for image is as below :.
Refer to API guide for more details.
TreeView
Tree view is a simulated browser in which the mode of simulation is tree view mode. All the objects of the web page will be displayed in hierarchical manner. The working of tree view is same as simulated IE. Treeview is the most recommended of all the views as it captures all the DOM information very accurately.
When to use the treeview: If you are an advanced user, it is always best to use the treeview to create WET scripts and object depots. In other cases, the Wet Treeview is to be used if the simulated IE mode does not provide an accurate representation of the actual page.
Find N Filter options : (option applicable only to treeview)
Find and filter options are available only for tree view mode to search and filter the object from the list. The way to find or filter is exactly the same. In terms of the results, the difference is that when you say 'find', the relevant elements are highlighted. When you say filter, only those items that match the filter critirea are displayed. All other items are removed from the treeview. While filtering the view or finding objects, you have to supply:
The type of the object
One property key value
pair.
The value part in the key-value pair can either be a
string literal or a regular expression.
For example to filter (or find) a web link whose text is 'Hindi', choose the View -> Filter menu option. Now in the resulting dialog, choose Link for the type, text for the key field and Hindi for the value field. and hit select.
After selecting the object the tree view obtained will be only for that object as shown below.
In the above case, for the 'value' field, you may also use regular expressions. To specify regular expressions, you have to enclose the search string within two forward slashes(/.../) So instead of Hindi, you could say /Hin/ and in this case, all links whose text has Hin in it are filtered.
To search a object use find view menu option. A form is obtained enter the object to be search the object gets selected in the tree view as below .
Next steps:
Using the simulated browser, you will be able to create the basic test scripts and the object depot. In case you want to modularize these scripts or object depot, you will have to edit these scripts separately. After doing so, you will have to create and edit the test definition to create robust tests.
Summary:
The simulated browser allows tester to perform various options in a controled (simulated) environment to generate test scripts easily for WET. Unlike the conventional record and playback, scripts generated using the simulated browser are generated using a tester instructing the browser to do things rather than allowing the tool to blindly make guesses.