Vb scripting for uft tutorial
![vb scripting for uft tutorial vb scripting for uft tutorial](https://quicklearnautomation.files.wordpress.com/2017/01/f893d-uft2baddin2bhelp.png)
The basic difference between a “Do while – Loop” and “Do – Loop while” is that the previous one gets executed only when the condition in the while statement holds true where as a “Do – Loop while” gets executed atleast once, because the condition in the while statement gets checked at the end of the first iteration. The condition can be checked before entering into the loop or after the loop has run at least once. While Keyword can be used to check a condition in a Do – Loop construct. The statements are repeated either while a condition is true or until a condition becomes true. The following looping constructs are available in VBScript.ĭo – Loop statements are used to execute a block of statements based on a condition. The loop runs as long as the condition is true. The loop is repeated based on a condition. Looping allows to run a group of statements repeatedly. If there is a match, the block of statements associated with that Case is executed.įor example: Select Case (SelectedIndex).TextĬase Else DisplayUnknownImage PromptAgain The result of the expression is then compared with the values for each Case in the structure.
VB SCRIPTING FOR UFT TUTORIAL CODE
The Select Case Construct makes code more efficient and readable.Ī Select Case structure works with a single test expression that is evaluated once, at the top of the structure. The Select-Case structure is an alternative to If Then Else for selectively executing one block of statements from among multiple blocks of statements. A better way to choose between several alternatives is the Select Case statement. Extensive use of the ElseIf clauses often becomes cumbersome. You can add as many ElseIf clauses as you need to provide alternative choices. The If- Then – Else statements can be nested to as many levels as needed.įor example: Sub ReportValue(value)If value = 0 ThenMsgBox valueElseIf value = 1 ThenMsgBox valueElseIf value = 2 thenMsgbox valueElseMsgbox "Value out of range!"End If Usually the condition is an expression that uses a comparison operator to compare one value or variable with another. The If – Then- Else Construct is used to evaluate whether a condition is true or false and depending on the result, to specify one or more statements to execute.
![vb scripting for uft tutorial vb scripting for uft tutorial](https://www.softwaretestinghelp.com/wp-content/qa/uploads/2018/01/VBscript-tutorial.jpg)
The following conditional constructs are available in VBScript Here, we will dwell upon conditional constructs, iterative constructs and arrays.Ĭonditional Constructs execute statements or repeat certain set of statements based on conditions.
VB SCRIPTING FOR UFT TUTORIAL SERIES
This is in continuation from VB Script and QTP – Part1 on our series of posts on VB Script.