Click Yes or No button if windows popup appear

194 views
Skip to first unread message

Newbie

unread,
Aug 18, 2008, 2:10:33 PM8/18/08
to QTP - HP Quick Test Professional - Automated Software Testing
Hi all QTP experts,
I'm currently experiencing difficulties in scenario below.
Please advise.

Scenario:
If a popup appear then would like to click yes button.

Would like to script if this appear then then yes, otherwise, ignore
the scripts and proceed to next scripts.
Is there a way to do this?

Thanks!
Newbie

Srinivas Pavuluru

unread,
Aug 18, 2008, 3:34:50 PM8/18/08
to Mercu...@googlegroups.com
Use recovery scneario's  ..
--
With Regards
Srinivas P
Contact Numbers
0091-9849466927 (Mobile Hyderabad)
0091-40-24060750 (Resi)

Srinivas Pavuluru

unread,
Aug 18, 2008, 3:43:58 PM8/18/08
to Mercu...@googlegroups.com, yee...@gmail.com
Hi Newbie
 
Create recovery scenario by using recovery scenario manager.  Add created scneario to existing script, mention "recovery.Activate" in your script.
 
recovery.Activate
 
 
This will solve your question.  Please let me know if you need any other ways to do this.  
 
We can also do it by writing some function.  Calling function where ever it is required. 
 
Thanks & Regards
Srinivas P

Ganesh muralidharan

unread,
Aug 18, 2008, 6:16:04 PM8/18/08
to Mercu...@googlegroups.com
Hi,

Try recording a recovery scenario which will be executed whenever the popup comes up.
--
Ganesh Muralidharan
Wipro Technologies
Mob. : 9341023574

'God Never Forgets'

Azriana Binti Ahmad

unread,
Aug 18, 2008, 8:57:19 PM8/18/08
to Mercu...@googlegroups.com
Example:
 If Browser("").Dialog("Windows Internet Explorer").WinButton("Yes").Exist Then
  Browser(" ").Dialog("Windows Internet Explorer").WinButton("Yes").Click
else
  SubLogMessage "No Message box appear","ok"
 End If

--
Regards,
Azriana Binti Ahmad

Dhanasekar Subramaniam

unread,
Aug 19, 2008, 7:54:06 AM8/19/08
to Mercu...@googlegroups.com
Check for the window.exist condition
Then if exist click yes button else part can be ignorned
 
Regards,
Dhanasekar S
--
Regards,
Dhanasekar S.
---------------------------------------------------------
Let us make the World Greener
http://www.greenpeace.org/international/
-----------------------------------------------------------

Bharath QTP

unread,
Sep 12, 2008, 1:07:10 AM9/12/08
to Mercu...@googlegroups.com
Hi..
 
you can also use exit(0) like the below statement which will reduce the wait time.
 
if Browser("").Dialog("Windows Internet Explorer").WinButton("Yes").Exist(0) then
       Browser("").Dialog("Windows Internet Explorer").WinButton("Yes").Click
End if
 
Thanks,
Bharath

Message has been deleted

gaurav sharma

unread,
Feb 27, 2013, 9:01:08 PM2/27/13
to mercu...@googlegroups.com
Hi Newbie,

The answers mentioned above by team members are absolutely correct.I would like to give u a brief regarding your scenario.

1. Use of ON ERROR RESUME NEXT command.- When we are sure at what step the pop up will come.
Then use ON ERROR GOTO 0 command- to disable the command once it has performed your desired task.

2. Use Recovery scenario->  Trigger- POP UP
                                          Recovery - click of mouse or keyboard operation
                                          Post Recovery - proceed to next step.

I hope u must have got the idea to deal with such scenarios.

Regards,
Gaurav

On Wed, Feb 27, 2013 at 1:22 PM, Prasun Jha <prasunj...@gmail.com> wrote:
Hi Newbei, 
I thing to know for answering your questing.
Do you know exactly where your pop can pops, like after execution of 10th line or doing some action, pop up may appear depending upon application. If you know that that than you use .exist mathode with if else condition already suggested in above replies. 
Otherwise you have to use recovery scenarios (should be ignored in real time).

--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
 
---
You received this message because you are subscribed to the Google Groups "QTP - HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mercuryqtp+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
GAURAV SHARMA
S/W ENGG.
ACCENTURE
Reply all
Reply to author
Forward
0 new messages