Through QTP Descriptive Programming I want to click on OK button in a dialog Box...Please Help me OutDoesnot

7,706 views
Skip to first unread message

Suparna

unread,
Aug 25, 2011, 11:46:11 PM8/25/11
to QTP - HP Quick Test Professional - Automated Software Testing
Hey Friendz...Pls help me out from this...I am tryng from last couple
of days...bt all are went in vain...

I am automating an web based application,in which I have to click on a
"OK" button coming through a popup window.

have tried this code:
Browser("micclass:=Browser").Dialog("Name:=Microsoft Internet
Explorer").WinButton("Name:=OK").Click

I also tried adding another property to dialog

Browser("micclass:=Browser").Dialog("Name:=Microsoft Internet
Explorer").WinButton("Name:=OK","Window ID:=2").Click

nd this also

Browser("micclass:=Browser").Dialog("micclass:=Dialog").WinButton("Name:=OK","Window
ID:=2").Click

nothnig recognised the dialog box.

Please suggest me the suatable code...

Thanks.

Rgds,
Suparna

Chethana KP

unread,
Aug 26, 2011, 12:23:08 AM8/26/11
to mercu...@googlegroups.com
Suparna,
 
i think problem is object hierarchy .
 
 
it should be like this :
Window("nativeclass:=").Dialog("nativeclass:=" ,"regexpwndtitle:=").exist or give 2 min wait before clicking on the button
 
Window("nativeclass:=").Dialog("nativeclass:=").WinButton("Name:=OK").click
 
and try to give unique mandatory properties for identification.
 
~Chethana

 
--
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

suman ch

unread,
Aug 26, 2011, 12:32:29 AM8/26/11
to mercu...@googlegroups.com
What's th error message u r getting..?
 
Is it Browser not identifying or Window or WinButton.
 
Add the objects to a repository and then use the peoperties that used in the OR and try.
 
It should be like this..
 
Browser("creationtime:=0).Dialog("regexpwndtitle:="""name""").WinButton("name:=OK").Click
Regards,
Suman Ch

santhosh Ganji

unread,
Aug 26, 2011, 1:45:02 AM8/26/11
to mercu...@googlegroups.com
Hi Suparna,
 
You are saying that its coming with popup window right?
Why dont you use RSM trigger?

On Fri, Aug 26, 2011 at 9:16 AM, Suparna <suparnad...@gmail.com> wrote:
--
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



--
Thanks and Reagards
Santhosh G
+918007850250


Shalabh Dixit

unread,
Aug 26, 2011, 1:27:40 AM8/26/11
to mercu...@googlegroups.com
No so sure... but may be creating a recovery scenario for it might help.
let's try it out as well if u want...!!


Regards
Shalabh Dixit

Rajiv Nanduani

unread,
Aug 26, 2011, 1:53:15 AM8/26/11
to mercu...@googlegroups.com
refer this

http://testeverythingqtp.blogspot.com/2011/05/handle-popup-dialog-window-in-browser.html

On Fri, Aug 26, 2011 at 9:16 AM, Suparna <suparnad...@gmail.com> wrote:
--
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



--

Regards

RAJIV KUMAR NANDVANI

http://rajivkumarnandvani.wordpress.com
http://testeverythingqtp.blogspot.com/




MADHU KUMAR

unread,
Aug 26, 2011, 1:33:08 AM8/26/11
to mercu...@googlegroups.com

Web applications hierarchy will be as follows

Browser
      |_Page
            |_Win1
                 |_Win-n
                        |_Frame
                               |_Object

Check your object falls under ???
What kind of button is it ? is it Webbutton or winbutton??


On Fri, Aug 26, 2011 at 9:53 AM, Chethana KP <chethu...@gmail.com> wrote:



--
Madhu A Kumar

Venkatraman

unread,
Aug 26, 2011, 4:17:31 AM8/26/11
to mercu...@googlegroups.com
Dear All,

We have an immediate requirement for Pune HSBC and below is the JD
1. Strong testing process knowledge.
2. Experience in Backend testing.
3. Good experience in SQL
4. Knowledge of QC a must.
5. Experience in Finance domain. Knowledge of Private Banking - Good to have
 
How soon you can join.

Thanks,
Venkat
Send me your resume to nv.r...@gmail.com
On Fri, Aug 26, 2011 at 9:16 AM, Suparna <suparnad...@gmail.com> wrote:
--
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



--
Regards
Venkatraman

Suparna

unread,
Aug 26, 2011, 7:16:31 PM8/26/11
to QTP - HP Quick Test Professional - Automated Software Testing

Hi Chethana,

Thanx 4 replying :)

I tried out with this...but it wont work.

If Window("Browser:= ").Dialog("Dialog:=Windows Internet
Explorer" ,"regexpwndtitle:=Windows Internet
Explorer").WinButton("text:=OK","window id:=").exist then
msgbox "Button Exist"
Window("Browser:= ").Dialog("Dialog:=Windows Internet
Explorer" ,"regexpwndtitle:=Windows Internet
Explorer").WinButton("text:=OK","window id:=").click
else
msgbox "Button doesnt Exist"
End if

but when I run this scripts QTP doesnt recognise the button and at the
Result I get "Button doesnot Exist"
> >http://groups.google.com/group/MercuryQTP?hl=en- Hide quoted text -
>
> - Show quoted text -

Suparna

unread,
Aug 26, 2011, 7:23:12 PM8/26/11
to QTP - HP Quick Test Professional - Automated Software Testing
Hi Suman,

Thanks for replying :)
Actually I want to do it through Descriptive Programming approach.
I tried with this.

If Window("creationtime:=0 ").Dialog("Dialog:=Windows Internet
Explorer" ,"regexpwndtitle:=Windows Internet
Explorer").WinButton("text:=OK","window id:=").exist then
msgbox "Button Exist"
Window("creationtime:=0").Dialog("Dialog:=Windows Internet
Explorer" ,"regexpwndtitle:=Windows Internet
Explorer").WinButton("text:=OK","window id:=2").click
else
msgbox "Button doesnt Exist"
End if

but at the end I get the result that "Button doesnot Exists"
QTP is unable to recognise the WinButton.
Do you have any idea how to make this winbutton recognisible to QTP ?

Regards,
Suparna

On Aug 26, 9:32 am, suman ch <suman...@gmail.com> wrote:
> What's th error message u r getting..?
>
> Is it Browser not identifying or Window or WinButton.
>
> Add the objects to a repository and then use the peoperties that used in the
> OR and try.
>
> It should be like this..
>
> Browser("creationtime:=0).Dialog("regexpwndtitle:="""name""").WinButton("na­me:=OK").Click
> Regards,
> Suman Ch
>
>
>
> On Fri, Aug 26, 2011 at 9:53 AM, Chethana KP <chethu.ch...@gmail.com> wrote:
> > Suparna,
>
> > i think problem is object hierarchy .
>
> > it should be like this :
> > Window("nativeclass:=").Dialog("nativeclass:=" ,"regexpwndtitle:=").exist
> > or give 2 min wait before clicking on the button
>
> > Window("nativeclass:=").Dialog("nativeclass:=").WinButton("Name:=OK").click
>
> > and try to give unique mandatory properties for identification.
>
> > ~Chethana
>

Suparna

unread,
Aug 26, 2011, 7:26:39 PM8/26/11
to QTP - HP Quick Test Professional - Automated Software Testing
Hi Shalabh,

I just check through code weather the Button exist or not.
Actually this is a WinButton,and QTP is not able to recognose the
button thats y when i run my code it will not clicking the button.

What kind of recovery scenario u suggest me to give...if you dnt mind
could you please tell me in details.

Rgds,
Suparna

On Aug 26, 10:27 am, Shalabh Dixit <shalabh.di...@gmail.com> wrote:
> No so sure... but may be creating a recovery scenario for it might help.
> let's try it out as well if u want...!!
>
> Regards
> Shalabh Dixit
>
>
>
> On Fri, Aug 26, 2011 at 10:02 AM, suman ch <suman...@gmail.com> wrote:
> > What's th error message u r getting..?
>
> > Is it Browser not identifying or Window or WinButton.
>
> > Add the objects to a repository and then use the peoperties that used in
> > the OR and try.
>
> > It should be like this..
>
> > Browser("creationtime:=0).Dialog("regexpwndtitle:="""name""").WinButton("na­me:=OK").Click
> > Regards,
> > Suman Ch
> > On Fri, Aug 26, 2011 at 9:53 AM, Chethana KP <chethu.ch...@gmail.com>wrote:
>
> >> Suparna,
>
> >> i think problem is object hierarchy .
>
> >> it should be like this :
> >> Window("nativeclass:=").Dialog("nativeclass:=" ,"regexpwndtitle:=").exist
> >> or give 2 min wait before clicking on the button
>
> >> Window("nativeclass:=").Dialog("nativeclass:=").WinButton("Name:=OK").click
>
> >> and try to give unique mandatory properties for identification.
>
> >> ~Chethana
>

Suparna

unread,
Aug 26, 2011, 7:30:12 PM8/26/11
to QTP - HP Quick Test Professional - Automated Software Testing
Hi,

Thanks for replying.

This is a "WinButton"
and the hierarchy is
*Browser*
I_ *Dialog*
I_*WinButton

I tried with my code.
But each time QTP is not recognise this WinButton.
Could You pls suggest me anythng to solve this.

Regards,
Suparna



On Aug 26, 10:33 am, MADHU KUMAR <madhuaku...@gmail.com> wrote:
> *
> *
> *Web applications hierarchy will be as follows*
> *
> *
> *Browser*
> *      |_Page*
> *            |_Win1*
> *                 |_Win-n*
> *                        |_Frame*
> *                               |_Object
> *
> Check your object falls under ???
> What kind of button is it ? is it Webbutton or winbutton??
>
>
>
>
>
> On Fri, Aug 26, 2011 at 9:53 AM, Chethana KP <chethu.ch...@gmail.com> wrote:
> > Suparna,
>
> > i think problem is object hierarchy .
>
> > it should be like this :
> > Window("nativeclass:=").Dialog("nativeclass:=" ,"regexpwndtitle:=").exist
> > or give 2 min wait before clicking on the button
>
> > Window("nativeclass:=").Dialog("nativeclass:=").WinButton("Name:=OK").click
>
> > and try to give unique mandatory properties for identification.
>
> > ~Chethana
>
> *Madhu A Kumar*- Hide quoted text -

Suparna

unread,
Aug 26, 2011, 7:43:16 PM8/26/11
to QTP - HP Quick Test Professional - Automated Software Testing
Hi Santosh,

Thanks for replying.

This is a pop up Window.
Actually i knw wat is Recovery Scenario Managr but how to use RSM
Trigger here I dnt get any idea.

If you dnt mind could you please explain me how I add RSM Trigger in
my code?

Let see this is my code which I tried.
If Window("creationtime:=0 ").Dialog("Dialog:=Windows Internet
Explorer" ,"regexpwndtitle:=Windows Internet
Explorer").WinButton("text:=OK","window id:=").exist then
msgbox "Button Exist"
Window("creationtime:=0").Dialog("Dialog:=Windows Internet
Explorer" ,"regexpwndtitle:=Windows Internet
Explorer").WinButton("text:=OK","window id:=2").click
else
msgbox "Button doesnt Exist"
End if

Here QTP is not able to recognise the "WinButton".

Regards,
Suparna

On Aug 26, 10:45 am, santhosh Ganji <santhoshkumar.qual...@gmail.com>
wrote:
> +918007850250- Hide quoted text -

Girisshhh

unread,
Aug 28, 2011, 1:31:45 PM8/28/11
to QTP - HP Quick Test Professional - Automated Software Testing
Hi,
I Faced a similar problem , solved it using ...

Dialog("Name:=Microsoft Internet
Explorer").WinButton("Name:=OK").Click


Regards,
Girish

On Aug 26, 10:45 am, santhosh Ganji <santhoshkumar.qual...@gmail.com>
wrote:

Chethana KP

unread,
Aug 29, 2011, 3:21:51 AM8/29/11
to mercu...@googlegroups.com
First diagnose the object identification by adding the objects to the local repository and check that object being recognized in run time.
 
Second step: with maximum wait  try to click on the win button object
 
Browser().dialog().winbutton().click
 
~Chethana

santhosh Ganji

unread,
Aug 29, 2011, 2:17:07 AM8/29/11
to mercu...@googlegroups.com
Hi Suparna,

RSM is a concept of QTP by using this u have to create a .qrs file and associate it to the test...
Please follow this steps to create qrs file
QTP Resources --> Recovery scenario manager
Select New...
Click next
Select Popup window and next
Click on the handler icon and show the popup window ( In AUT )
Click on next button for 2 times
Select keyboard or mouse operations and next
Select click the button with label and show the OK button on the popup window and click on next
* Uncheck add another recovery operation (If you want to add one more you can leave it)
Select any one of the postrecovery operations and click on next and then finish.


Save it and add to the recovery tab in File --> Settings --> Recovery for your test

Run the test it will click the OK Button...

All the best.

raghu busireddy

unread,
Aug 29, 2011, 7:51:19 AM8/29/11
to mercu...@googlegroups.com
Hi Suparna,

use this code.it will work

Browser("micclass:=Browser","CreationTime:=1").Dialog("regexpwndtitle:=File Download").WinButton("attached text:=192.168.10.182").Click

Reply

Raghu.

Anish Pillai

unread,
Aug 30, 2011, 3:33:56 PM8/30/11
to mercu...@googlegroups.com
Hi Suparna,

Did you try using 'nativeclass' property for the dialog box? 'nativeclass' is one of the default properties that get added and it usually works when used with descriptive programming.

Also you can try to add the object in OR first and see what all properties are being used to identify it. You can use the same in your descriptive programming code.

Also, whenever you have popup message displayed, the focus would most probably be on any of the buttons in the dialog box. If nothing works, you can use SendKeys method to click the button inside the popup.


Hope this helps...

--
Regards,
Anish Pillai
My QTP Blog

Kishor Kumar

unread,
Aug 30, 2011, 8:34:02 PM8/30/11
to mercu...@googlegroups.com, suparnad...@gmail.com
Hi Swapna,
What if Test Environment you are using is Win7 (64 bit 0r 32 bit) + QTP10 + IE8. 
then surely you will get issues with IE Dialog. QTP Will not properly identify your objects.
Please reply with details,so that I can suggest the solution.

Regards,
Kishor

AK

unread,
Aug 31, 2011, 1:34:42 PM8/31/11
to mercu...@googlegroups.com
Try
'Browser("micclass:=Browser").Dialog("Name:=Microsoft Internet Explorer").WinButton("Name:=OK").Move x,y

Browser("micclass:=Browser").Dialog("Name:=Microsoft Internet Explorer").WinButton("Name:=OK").Move 50,50

udaykumar vutukuru

unread,
Aug 31, 2011, 2:08:58 PM8/31/11
to mercu...@googlegroups.com
Hi suparna
this is Recovery Scenario problem. In framework folder there is a
folder as Recovery Scenario. That popum window u can make it as a
recovery scenario
Reply all
Reply to author
Forward
0 new messages