When the For loop terminates the value of iTemp is displayed in the message box and it will display value 10.
Vb scripting for uft tutorial how to#
The following example shows how to use a For loop.The variable iNumber is initialized to 10 and iTemp is initialized to 0.The counter variable is set to 1 and the loop will continue to iterate until the value of the counter variable becomes equal to iNumber that is 10. The value of iTemp variable increments by 1 on each iteration.
Vb scripting for uft tutorial series#
This parameter should only be used if you want to increase the value of counter more by more than one (say 2 or 3, etc) on each iteration.Ī statement, or series of statements, to be performed during the loop. The number to increment at the end of each loop. The last number of the counter at which the Loop should stop The variable is used as a counter for the number of iterations of the For Loop. The following is the syntax of For.Next loop. When the value of the counter becomes 10 the while condition becomes false and the do loop will exit.Ī For…Next loop instructs UFT One to iterate one or more statements a specified number of times. HP Unified Functional Testing Tool (formerly known as QTP) is widely used functional testing tool, In this tutorial series, We will walk you through the basic & advanced features of UFT, Implementation of Hybrid framework, UFT integration with ALM and Jenkins, Real time scripting challenges, Deep dive on each feature of UFT etc. The value of the counter variable increments by 1 on each iteration and the do loop will continue to iterate until its value is less than 10. The iNumber variable is initialized to 10 and the counter variable is initialized to 0. In today’s scenario, VBScript has turned out to be a very important topic, especially for beginners who wish to learn the scripting language or automation tools like QTP/UFT.
In the following example, I have taken two variables iNumber and counter. Introduction to Microsoft VBScript (Visual Basic Script): VBScript Tutorial 1. The Do…Loop statement instructs UFT One to iterate a statement or series of statements while a condition is true or until a condition becomes true. > Click Here For The QTP Training Tutorials Series > Also read the complete free VBScripting Tutorial series here In the last VB Scripting article, we saw some of the basic features of the VB script.We are going to learn a few more programming concepts before we conclude our introduction series. 2.3 Exit a While Loop When a Certain Condition is Met VB Scripting Basics - Writing Loop and Conditional Statements for Building the Programming Logic.2.2 Exit a For Loop When a Certain Condition is Met.2.1 Exit a Do Loop When a Certain Condition is Met Tutorial 11 Launch an App using UFT Invoke Application SystemUtility.Run.
2 How to Exit a Loop When a Specific Condition is Met.