- Recording
- By Scripting.
1. Recording
It is fairly simple and all one has to do is press Record button and then perform actions as a user would normally. These actions are stored and then can be played back again & again for regression purposes. It uses an object repository to store different properties of elements on the page. e.g. a drop-down list with properties such as name, list values, x and y co-ordinate etc are all store in the repository.
Based on this, it becomes easier for QTP to recognize a specific element and perform functionality accordingly.
2. Scripting
This is the method that I used the most. The language used is VBScript. If you have some hands on experience with VBScript you can really use it to your advantage. The VBScript in combination with scripting language handles many functionalities mimicking end user.
The method certainly has some dis-advantages attached to it. It you are purely using Scripting for testing purposes, you will have to handle a lot of properties for an element. Here are a few reasons for why I am saying this
- Lets say there is a drop-down list which has a name: list1 and id: weblist1. Now if these two tags remain the same you are good to go, otherwise, if they are removed or changed, your script will break or shoot an error.
- Secondly, if the page is not coded in a good fashion, many of your elements may end up having the same tags. On this QTP shoots an error of "many elements with same id. unable to identify"
- Thirdly if you resort to using Index values, which I highly discourage. At any point in time, the screen layout may change and the element that your indexing, its index will either increase or decreasee. Hence you will loose reference of your element.
- If you do not have your elements defined properly, it may cause QTP to halt your machine for a minute or two especially if you are on a report page which has a list of elements which are read-only and do not have well defined ids.
No comments:
Post a Comment