Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Step time interval
#1
Solved: 11 Years, 4 Months ago
Is there a way to define time interval for each step, meaning that the step should not take more than a certain amount of time and if does either skip the step or fail the test.
Reply
#2
Solved: 11 Years, 4 Months ago
Hi,

Check for "Object synchronization timeout" under File-->Settings-->Run

You can specify a value in second and QTP will wait for that amount of time for every object to be in a specific state. If the time exceeds the specified synchronization timeout, the step will fail.
Reply
#3
Solved: 11 Years, 4 Months ago
But what if the current step is taking too much time and I want to terminate it if it exceeds a certain amount of time?
A simple example, saving a file and the save process takes a lot of time, I want to terminate this step and go to the next step or even fail the whole test.

Not sure if my question is clear enough!
Reply
#4
Solved: 11 Years, 4 Months ago
for doing this you have two options 1) insert wait statement before the step or you can create dynamic synchronization point in the script
Reply
#5
Solved: 11 Years, 4 Months ago
Try with Wait() function
Reply
#6
Solved: 11 Years, 4 Months ago
Ok, i got you. Even i have implemented scenarios like this. But this can be solved by creating your own situational based solutions. As far as i know, QTP directly will not help you on this occasion.

In one my projects, the situation was like there was an object which could be at different statuses at different times (one status at a time). The staus used to change after some event occurs to that object. So after making an event happen on that object, the testing need was to wait till the status changes (say from "AAA" to "BBB") or wait for max 5 minutes and if the status doesn't change within 5 mins, make that step fail and proceed next.

I followed the approach below:

----code for necessary event to change the status
Code:
tCounter = 0 \\ Set a time counter to 0
getStatus = Brower("").Page("").WebTable("").GetCellData(row,col) //status was displayed in a particular cell of a webtable
While (getStatus <> "BBB" And tCounter < 5)
     Wait(60)
     tCounter = tCounter + 1
     getStatus = Brower("").Page("").WebTable("").GetCellData(row,col)
Wend
If getStatus <> "BBB" Then
   Reporter.ReportEvent micFail,"step","desc"
End If

Hope you will get an idea now to design your own approach!
Reply
#7
Solved: 11 Years, 4 Months ago
How QTP works is this. it executes the instruction given on the line and then moves on to the next step.
You can use , wait or waitproperty() to make it wait after executing some step.
If you invoke a command line , then again you have a parameter to make QTP wait till the command in the command prompt is executed completely.

There are ways how we can increase the time of execution of each step.
Tools->option -> Run -> Normal display execution( you can customize the delay there) , but this is for all the steps and not for one particular step.
You can choose one out of these.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  QTP does not record the first step of open filight reservation application. Blossoms 9 17,768 07-20-2015, 05:50 PM
Last Post: AJAJ
  step by step report shipu 0 2,161 08-06-2014, 02:21 AM
Last Post: shipu
  which is the final step of automation in QTP? Ramadas 6 3,935 10-29-2013, 04:31 PM
Last Post: Sathiya
  QTP is not recording the first step of opening Flight reservation app srinanduri 2 3,176 08-06-2013, 09:59 PM
Last Post: srinanduri
  How to continue test after it fails a step sqadri 4 4,572 01-20-2012, 10:02 PM
Last Post: sqadri

Forum Jump:


Users browsing this thread: 1 Guest(s)