03-13-2009, 08:05 PM
QTP Version 9.2
Add-Ins Web
Scenario:
In the following code, the QTP executes line #1, and jumps to execute line #2 however the application is still busy in line#1. The Line #2 is skipped and Value2 is not populated in Field 1.
Code 1:
In the following code, wait statement is used to wait for 5 seconds before running the next instruction.
Code 2:
Using wait statement between instructions at line #2, it works fine.
Issue:
If I remove wait statement from Code 2, sometime line #3 is skipped.
If I use Page.Sync at line #2, it does not do anything.
Question:
1. What is the best way to make sure that line #3 will not be skipped, and it will run regardless on fast or slow machine?
2. What I can use at line #2 instead of using wait (5) statement so that it makes sure line #3 will not execute until line #1 is completed successfully.
Thanks
Farhan
Add-Ins Web
Scenario:
In the following code, the QTP executes line #1, and jumps to execute line #2 however the application is still busy in line#1. The Line #2 is skipped and Value2 is not populated in Field 1.
Code 1:
Code:
#1. Call SelectObject(.WebList("Field 1"), Value1)
#2. Call SelectObject(.WebList("Field 2"), Value2)
In the following code, wait statement is used to wait for 5 seconds before running the next instruction.
Code 2:
Code:
#1. Call SelectObject(.WebList("Field 1"), Value1)
#2. wait(5)
#3. Call SelectObject(.WebList("Field 2"), Value2)
Using wait statement between instructions at line #2, it works fine.
Issue:
If I remove wait statement from Code 2, sometime line #3 is skipped.
If I use Page.Sync at line #2, it does not do anything.
Question:
1. What is the best way to make sure that line #3 will not be skipped, and it will run regardless on fast or slow machine?
2. What I can use at line #2 instead of using wait (5) statement so that it makes sure line #3 will not execute until line #1 is completed successfully.
Thanks
Farhan