![]() ![]() Integrated Treeview |
Courses in c#, ruby, shell scripting, Software testing courses and more
|
|||||||||||||||||||||||||
|
WET-Integrated TreeView
WET-Integrated TreeView is a windows application meant for advanced WET scripters through which WET scripts can be easily created. The integrated treeview also allows for easy creation of object depots. The Integrated Treeview is a separate application in WET's start menu programs (It is not a part of the WET Manager Interface)
Using the Integrated treeview, a tester can either directly connect to open IE browsers or launch new IE Browsers. Once connected the information about that IE browser is displayed in a hierarchical treeview. This treeview has various options in its context menu to add 'WET functions' to a script window. Simultaneously an object depot file is also created.
Using the WET Treeview
To launch the integrated WET Treeview, use the start menu choose Qantom -> WET -> Integrated Treeview. The UI of WET-Integrated TreeView looks as given below(the main screen):
Syncing with IEs
There are two ways in which one could work with IE windows –
By syncing with an open IE window on your system
By launching a new IE Window
1. Launch Browser option:
From WET-Integrated Treeview window,click on Tools->Launch Browser option and a navigate box opens and in the navigate box,type in an url which is required to be tested for (ex:http://www.google.com.) A new IE Browser window opens on your system and the Google page gets launched. The objects on the Google page appears as a Treeview on WET-Integrated Treeview.
Illustration
1: When Google is launched
2. Sync with Browser option:
Open a new IE Browser directly on your system (not using WET) and navigate to the required web page say for ex:http://www.google.com From WET-Integrated TreeView,click on View->Sync with browser.The google page and its contents appear as tree view on the WET-Integrated TreeView exactly as in the previous case.
Working with Objects:
After syncing with the remote browser, one can directly work on the objects in the treeview using the context menu of each object – For example, you can click on a link, set textfield, etc., When these operations are performed, they are only reflected in the generated script and the generated object depot. Unlike a simulated browser, in the integrated treeview, these operations are not performed on the real browser by default. For example, if you do a 'click' operation on the link, then the integrated treeview's objectdepot is updated so that the link's definition is added and a click script line is generated on the right hand side script editor. However the same click is NOT performed on the real browser by default. It is possible to actually perform the operation but that will be discussed in the configuration section.
Object Depot:
The integrated treeview has a panel to display object depots. This can be seen by using the 'view -> object depot' option. An object depot is a xml file that describes all the objects to be used for testing the application. See the document on Object Depots itself for more information.
Using the integrated treeview, object depots can be created very easily – either by double clicking on the element in the treeview on the left or performing operations on the treeview. The object depot created in the integrated treeview cannot be edited directly. To edit it, you need to use the object depot manager application.
Scripts can be generated directly by working on the object depot panel in the integrated treeview application.
File Operations
As in any typical windows application, the integrated treeview has file operations like open, save, save as options. The only difference is that while doing any of the above operations, you also have to choose what kind of file you opening. To open a different script file in the script window, you have to choose the File->Open->Script. Likewise to open a different object depot file in the middle panel, you have to say File -> Open -> Object depot. Likewise for saving, you can either save only the changes to the script or the object depot or both at the same time.
Edit Operations
As usual edit menu has an option for Delete,Copy,Cut,Paste. These operations can be performed on the object depot where the objects get added. Also the object can be added to the object depot by right clicking on any of the object from the treeview on the left hand side and choosing Add to objectdepot option from the context menu.
View Operations
The View menu, apart from options for Syncing with browser, has other operations like filtering and searching. 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.
Tools Menu:
Tools menu has options for Launch Browser,Configure and Execute Test.
Launch Browser is used to launch the browser which is supposed to be tested, which we have already seen in the section that talks about synchronizing with the remote browser.
The 'configure' option controls some of the behavior of the integrated Wet treeview. Tools->Configure, is the way to access the configuration form. Currently only two configuration parameters are supported by the WET Treeview- a) option for setting scripting mode which to either - Object depot (which is the default) or Full definition view. If we choose object_depot view the scripts are generated as
object_depot("Link_iGoogle").click()
And if we choose the scripting mode as Full definition view,the script is generated as follows:
Browser("title"=>"Google").Link("text"=>"iGoogle").click()
Execute Test options is used to execute the test once the various operations are performed.
Next steps:
Using the integrated treeview, 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 Integrated treeview is a handy application that gives you the ability to create wet testscripts easily. The WET Treeview is meant to be used by advanced WET automation engineers
WET is a opensource automated web testing tool which uses Watir as the library to drive web pages. WET drives an IE Browser directly and so the automated testing done using WET is equivalent to how a user would drive the web pages. WET extends the scripting abilities of Watir and also offers the convenience of recorders. It is licensed under LGPL and BSD style open source licenses. |