Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I make sure QTP will run all instructions NO skip?
#1
Not Solved
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:
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
Reply
#2
Not Solved
Have you tried ".Active" statement in an if statement with a loop (I haven't done this myself for active only for exists so give it a try)

Something Like this

Code:
For i = 1 to 10000
    If SelectObject(.WebList("Field 2"), Value2).Acitive(0) then
       Call SelectObject(.WebList("Field 2"), Value2)
    Exit for
End if
Next
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help for instruction to click on Skip button in the warning message vijilesh 0 1,556 09-16-2018, 03:48 PM
Last Post: vijilesh
  How to make QTP Script to work when system gets locked? ramkumarad 6 12,603 11-02-2017, 03:37 PM
Last Post: Divv
  Local script to make compatible with QC automation2012 1 2,317 01-28-2015, 02:11 PM
Last Post: automation2012
  How to skip a For count? mv8167 2 2,530 10-23-2013, 07:06 PM
Last Post: mv8167
  How to make QTP take the value of a formula in a spreadsheet? utestqa 1 3,188 07-06-2013, 04:13 PM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)