Adding Programming Steps to QTP Scripts in Keyword ... - Google Sites

0 downloads 79 Views 161KB Size Report
Using conditional statements, you can incorporate decision making into your tests. Using loop statements, you can run a
Adding Other Types of Steps to Your Test

Page 1 of 3

Adding Programming Steps to QTP Scripts in Keyword View In addition to adding standard statement steps to your test using the Keyword View, you can also insert the following special types of steps using the relevant options from the Insert menu. Each step is entered as a row in the Keyword View.



 



You can insert a checkpoint step. You can insert an output value step. You can insert comments in steps to separate parts of an action or a test and to add details about a specific part. You can insert a step that sends information to the results, a step that puts a comment line in your test, a step that synchronizes your test with your application, or a step that measures a transaction in your test.



You can insert a step that calls a WinRunner test or function.



You can use conditional statements and loop statements in your test. For information on adding a new step immediately after a conditional or loop block.a

Using Conditional and Loop Statements in the Keyword View Using conditional statements, you can incorporate decision making into your tests. Using loop statements, you can run a group of steps repeatedly, either while or until a condition is true. You can also use loop statements to repeat a group of steps a specific number of times. Each statement type is indicated by one of the following icons in the Keyword View:

Icon

Type If...Then statement ElseIf...Then statement Else statement While...Wend statement

Adding Other Types of Steps to Your Test

Page 2 of 3

For...Next statement Do...While statement Do...Until statement

After you insert a conditional or loop statement in the Keyword View, you can insert or record steps after the statement to include them in the conditional or loop block.

Adding a Standard Step After a Conditional or Loop Block After you add a conditional or loop statement to your test, all steps that you add or record are automatically inserted within the conditional or loop statement block. After you have finished adding steps to the block, you can add a step outside of the block, at a sibling level to the conditional or loop statement step, as described below.

To add a standard step after a conditional or loop block: 1. Select the conditional or loop statement step after and outside of which you want to add the new step, and select Insert > New Step After Block or press SHIFT+F8. A new step is added to the Keyword View, at the end of the conditional or loop block, outside of the conditional or loop statement (as a sibling).

2. Specify the content of the step by modifying it.

Suggest Documents