HP QTP Utility Statements : Wait Statement
September 10, 2018
HP QTP Utility Statements : Wait Statement
Welcome to this post! – ” HP QTP Utility Statements : Wait Statement”.
If you are looking for HP UFT, QTP utility statements and their usages, then you are at right place. This post “HP QTP Utility Statements : Wait Statement” consists of concept discussion and usage discussion. Go ahead and enjoy reading…
This discussion will help you prepare well if you are going for the interview and can help you if you need the function to be used in your project test suite.
Wait Statement
Abstract
The Wait statement is used to set a pause during a run session.
The statement in itself falls under the category of utility statements and not utility objects.
Before we dig down deep into the usage let’s quickly visit some general questions.
In the interview usually, you might be questioned in different ways like:
- How to set wait in the test?
- Can you use both Wait and Sync one after the other?
- What are the objects and parameters of Wait statement?
- Is Wait is an object or statement?
Discussion
Whenever you require to take a pause in between 2 steps you must use the wait statement. The statement is quite straight and can be used effectively. The only part where you should take consideration is performance. The wait statement will, of course, introduces longer time duration for completion of execution than regular time.
You can also use this to have a pause in between two action’s calls.
There is a difference between sync and wait. Sync is a method which is once set against the test object will try to have the control gets loaded and completely rendered by the browser. The wait performed here is to check on the control’s visibility. That is, it checks the state of control got loaded or still loading. On the other hand the wait statement waits till the time tester has defined.
Syntax
Wait Seconds [, Milliseconds ]
Let’s see the parameters and their usage description for this statement:
Argument | Type | Description |
Seconds | Number | Number of seconds to wait between steps. |
Milliseconds | Number | Optional. Number of milliseconds to wait between steps. |
Example
The following example uses the Wait method to pause 10 seconds between selecting a ListItem1 and ListItem2 during the test run.
'example Browser("Some browser name").Page("Some page name").WebList("Some list name").Select "ListItem1" Wait(10) Browser("Some browser name").Page("Some page name").WebList("Some list name").Select "ListItem2"
This brings us to the end of our discussion on “HP QTP Utility Statements : Wait Statement”.
I really hope you have enjoyed reading this short post. If you have any doubt on this please feel free to add your comment below.
And if you like to read more on UFT or QTP Technical Interview Questions please follow below links:
UFT Technical Interview Questions – Set 1
UFT Technical Interview Questions – Set 2
How to Download Resource From QC\ALM?
How to Upload Resource To QC\ALM?
Or if you prefer General Interview Questions please follow below links:
UFT General Interview Questions – Part 1
UFT General Interview Questions – Part 2
If you would like to keep track of further articles on UFT (QTP). I recommend you to SUBSCRIBE by Email and have new UFT articles sent directly to your inbox.