There was a problem sending you an sms. Check your phone number or try again later.
We've sent a link to the Scribd app. If you didn't receive it, try again.
In order to create robust, efficient, and reusable WinRunner scripts, you will need to know these
basic programming concepts. The six topics covered in this WinRunner tutorial should give you a
basic understanding of what each is used for, the benefits of using it, and how it might be used with
WinRunner. This is not a comprehensive WinRunner tutorial. It's simply designed to introduce these
these concepts and give you a general idea of how to apply them with TSL (Test Script Language).
Variables are one of the most basic programming concepts and are heavily used in all programs. A
variable is essentially a character or string of characters that represents another string. For example,
let's say your data table's path is:
"C://WinRunner//MortgageApplications//Mort1//DataTables//Apply_Online.xls". If you had to specify
the full path each time you reference the data table, your WinRunner code might look something like
The above example also contained another variable. In the "for loop", which will be explained later,
the variable "i" is used to represent the current table row. A variable can be any character or string
of characters. It's best to pick a variable that describes it's purpose. When you do this, your code
becomes more readable and can be modified by others without a lot of research. The different types
of variables are beyond the scope of this WinRunner tutorial. For more information on variables, refer
to Mercury Interactive's WinRunner manuals or online help.
As you can see, if/else checks are simple, but can be very useful. They don't need to be used
together. You can use an "if" by it's self. Or you can use an "if" and then an "else if". When you run
into a scenario, where you need multiple if checks in a row, consider using a switch statement,
which is more efficient.
Arrays are used to split a string into subsections. Let's look at an example of how WinRunner can use
arrays. In this example, we'll split a string of colors, separated by a comma. Then we'll take
components of the array and use them to populate our application, which has a field for each color.
A switch or case statement is useful if you have a variety of conditions that may be true and need to execute a different block of code for each condition. Let's look at an example of how you might use a switch statement in WinRunner.
Now bringing you back...
Does that email address look wrong? Try again with a different email.