QTP does not recognize Dialog object

1,100 views
Skip to first unread message

Staci2s

unread,
Feb 17, 2009, 6:24:56 PM2/17/09
to QTP - HP Quick Test Professional - Automated Software Testing
Hello,

I am testing a web application. Upon submission of a webform, a pop-
up (class is dialog) opens. I am not able to get QTP to recognize
this Dialog popup using Descriptive Programming.

I 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", "Window ID:=0").WinButton("Name:=OK").Click

Finally, in trying to solve this problem, I decided to record and play
back to see if QTP would recognize. Here is the code generated by QTP
when recording.
Browser("MyBrowser").Dialog("Microsoft Internet Explorer").WinButton
("OK").Click

When I have recorded and the object has been added to the Object
Repository, QTP is able to find it. Does anyone have advice about how
can I make QTP recognize the object with Descriptive Programming only?

Thank you,

Staci

Roman Zilber

unread,
Feb 17, 2009, 8:10:08 PM2/17/09
to Mercu...@googlegroups.com
Well, if you decide to use descriptive programming, you need to learn debugging you code.

Use Watch window.
Print Object().Exist(0)
etc...

Another important thing in programming is to learn error messages. In our case it's QTP errors.

Staci2s

unread,
Feb 17, 2009, 8:53:27 PM2/17/09
to QTP - HP Quick Test Professional - Automated Software Testing
I have found the answer to my own question. I have used the wrong
property by mistake. Dialog does not have Name property but instead
Text.

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

should have been

Browser("micclass:=Browser").Dialog("Text:=Microsoft Internet
Explorer").WinButton("Text:=OK").Click

It's good to laugh at oneself for a silly mistake such as this.

On Feb 17, 5:10 pm, Roman Zilber <rzil...@gmail.com> wrote:
> Well, if you decide to use descriptive *programming,* you need to learn
> > Staci- Hide quoted text -
>
> - Show quoted text -

Andrey

unread,
Feb 18, 2009, 11:49:23 AM2/18/09
to QTP - HP Quick Test Professional - Automated Software Testing
Congratulations! :)
Usually it is worth to try to spy on the popup (you can use CTRL while
spying so that popup will remain visible).
Then from the spy results you can see what properties to include in
programmatic description.

-- Andrey
Reply all
Reply to author
Forward
0 new messages