Unified Functional Testing Practitioners Forum
cancel

QTP 11 Firefox Javascript Alerts

brianstill
New Member.

QTP 11 Firefox Javascript Alerts

I am runnign QTP 11 with the appropriate patches for firefox support...

 

The problem is that when a javacript alert pops up, it is totally invisible to QTP. I can see it, click it, etc, but to QTP it doest exist.

 

Object Spy identifies the objects behind the alert as though it were not even there.

 

Has anyone run across this issue? and if so, how were you able to interact with the popup?

7 REPLIES
Anshoo_Arora
Super Contributor.

Re: QTP 11 Firefox Javascript Alerts

Brian, can you share the url/snapshot or any other details of this page?


--
Anshoo Arora
Relevant Codes
LinkedIn
Highlighted
brianstill
New Member.

Re: QTP 11 Firefox Javascript Alerts

Unfortunately, confidentiality wont allow it...but talking to the dev, it is the standard javascript alert dialog.

In IE, I can interact with the popup, but in Firefox, it is like the alert doesnt even exist.

 

If I try to use Object Spy to see the alert, it simply gives me the information about the objects behind the alert as though the alert isnt even there.

akaiser2222
New Member.

Re: QTP 11 Firefox Javascript Alerts

http://berkeleyclubtennis.com/form.htm

 

This isn't the page I'm dealing with, but is essentially the same thing.  When you click on "Submit" a confirmation pops up, and I can't get QTP to recognize the alert message and click on OK.

 

Thanks

 

Anshoo_Arora
Super Contributor.

Re: QTP 11 Firefox Javascript Alerts

Brian, this should work just fine:

 

Browser("").HandleDialog micCancel
Browser("").HandleDialog micOK

 

I haven't had a chance to play with it much, but I am sure there is a DOM way as well. I will post my findings soon.


--
Anshoo Arora
Relevant Codes
LinkedIn
Anshoo_Arora
Super Contributor.

Re: QTP 11 Firefox Javascript Alerts

Additionally, you can also try this:

 

Browser("").EmbedScript "window.confirm = function() {return true;}"
Browser("").Object("").Click (Click button that throws the popup - the above code will handle it)

 

 

 


--
Anshoo Arora
Relevant Codes
LinkedIn
Faz Raja
New Member.

Re: QTP 11 Firefox Javascript Alerts

I trie to use the following:

Set objClientId = Browser("title:=Create Auction").Page("title:= Create Auction").RunScript("document.getElementById('client_id');")
objClientId .value = "215"
 
 
but I get an error:
Invalid or unqualified reference
Line (7): "objClientId .value = 215"

 

 

Manuel_Mejia
New Member.

Re: QTP 11 Firefox Javascript Alerts

Hi all, 

 

I managed this issue with firefox with those 2 sentences:

 

This one help you out the text inside the window if you need to validate that.

Browser("xxx:=yyy").GetDialogText 

 

And this one press the button inside the window in my case "OK" button.

Browser("xxx:=yyy").HandleDialog micOk

 

i hope it helps!!