Test dependant on transaction time

6 views
Skip to first unread message

Daim

unread,
Sep 9, 2009, 2:35:19 AM9/9/09
to QTP - HP Quick Test Professional - Automated Software Testing
There is a button say “Process”, which when clicked processes the
transaction.

The transactions are processed on different time slices. Some
transactions take 5 seconds, some even take 50 seconds.

I want to automate my test such that it is not dependent on time at
all. As soon as the transaction is completed, it should go to the next
step.


Manish Bhalshankar

unread,
Sep 11, 2009, 1:00:12 AM9/11/09
to mercu...@googlegroups.com
Hi Daim,
 
Is your application a Web based application?
If so than check if the browser is in busy state while the transactions are processed. For Browser busy you can use the following:
 
Dim i
i = 0
Do While Browser("micclass:=Browser", "title:=<title of your page?").Object.Busy
     i = i + 1
     If i = 100 Then
        Exit Do
     End If
Loop

--
Regards,
Manish | HPCP

Messanger IDs:
Skype: manishbhalshankar
Yahoo: manishbhalshankar
GTalk: manishbhalshankar

Daim Phillips

unread,
Sep 11, 2009, 7:36:43 AM9/11/09
to mercu...@googlegroups.com
This is a web based application and the transaction gets slower or faster depending upon the size of attachment. , e.g. following are the fields

Name
Address
Picture

This is one case.

Secondly, the performance of this page also gets affected depending on the number of users logged in. The fewer the number, the faster the transaction takes place on button click.

Manish Bhalshankar

unread,
Sep 14, 2009, 1:27:24 AM9/14/09
to mercu...@googlegroups.com
Hi Daim,
 
Is there any string displayed on the page such as "Transaction in Process" or any such string at the time the transaction is in process. If so, check for the existance of that string in the Do While loop.

Sreedhar Mallipeddi

unread,
Sep 14, 2009, 8:58:29 AM9/14/09
to mercu...@googlegroups.com
what happens ..once the upload is completed ...ie how the Name/Address/Picture fields trun in to for ex: they not editable or a message is displayed....try to capture those things and wait until..u get that message...
 
Thanks,
Sreedhar

On Fri, Sep 11, 2009 at 5:06 PM, Daim Phillips <daim...@gmail.com> wrote:



--
Mallipeddi Sreedhar
91-9000994721

Daim Phillips

unread,
Sep 14, 2009, 1:44:23 AM9/14/09
to mercu...@googlegroups.com
There is a success message that is displayed at the end of successful transaction

"Your transaction is completed"

Manish Bhalshankar

unread,
Sep 15, 2009, 1:20:50 AM9/15/09
to mercu...@googlegroups.com
Than use the Do While Loop & continue looping till this string is displayed.

Daim Phillips

unread,
Sep 15, 2009, 1:26:58 AM9/15/09
to mercu...@googlegroups.com
Why isn't anyone recommending to use sync or wait? I've heard about it, but don't know how to use them, that's why i was reluctant to say anything regarding that.

 I don't know how this Do While loop to solve this problem. Provide sample script for this scenario.

Thanks in advance

Dhanasekar Subramaniam

unread,
Sep 15, 2009, 4:27:32 AM9/15/09
to mercu...@googlegroups.com
Hi,
     Sync would be best option to solve this problem,
By default the sync time out is 20seconds,you can increase this from File-->Settings--> Run tab
temp.JPG

Do while also helps,because he has mentioned that there is a message displayed after a successful transaction.
So write a Do while loop to check for the message display.
NOTE : Don't forget to but a exit from the do while loop after certain time,if the message don't get displayed due to some reason,your script never gets out of Do While loop
Here is the logic
timeout = 60
1 = 1
Do
      i = i+1
loop message exit OR i > 60


Thanks,
Dhanasekar S
http://testingideas.wordpress.com



2009/9/15 Daim Phillips <daim...@gmail.com>



--
Regards,
Dhanasekar S.
http://testingideas.wordpress.com
---------------------------------------------------------
Let us make the World Greener
http://www.greenpeace.org/international/
-----------------------------------------------------------

Daim Phillips

unread,
Sep 15, 2009, 4:58:19 AM9/15/09
to mercu...@googlegroups.com
Thanks a lot for the details.

I need some more explanation on what you have provided me

The do while loop is confusing. What I understand is that it would exit the do loop after 60 seconds, right? where is the value of message (used in do while loop) that QTP will compare with?

How will I use sync against Process button? The sync seems to be a global timeout where if object doesn't appear completely, it would just timeout. How is it going to work for the success message on the same page.








Dhanasekar Subramaniam

unread,
Sep 15, 2009, 7:07:24 AM9/15/09
to mercu...@googlegroups.com
Daim Phillips,
    Manish has already given a similar solution in this mail chain earlier,

But i think you may need to use Do Until loop

Dim i
i = 0
Do
     i = i + 1
     If i = 100 Then
        Exit Do
     End If
Loop until browser("browser").page("page").webelement("Your transaction is completed").exist


Note : the above is just an example i am not sure about what type of object is displaying the text and object hierarchy,Spy the "Your transaction is completed" text to learn that


--
Regards,
Dhanasekar S.
http://testingideas.wordpress.com


2009/9/15 Daim Phillips <daim...@gmail.com>

Daim Phillips

unread,
Sep 15, 2009, 7:38:13 AM9/15/09
to mercu...@googlegroups.com
Thanks a lot. That really helps now :-)


Reply all
Reply to author
Forward
0 new messages