Re: QTP 11 Firefox Javascript Alerts (1967 Views)
Reply
Occasional Visitor
brianstill
Posts: 2
Registered: ‎03-13-2012
Message 1 of 8 (2,010 Views)

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?

Valued Contributor
Anshoo_Arora
Posts: 82
Registered: ‎07-06-2011
Message 2 of 8 (1,967 Views)

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
Occasional Visitor
brianstill
Posts: 2
Registered: ‎03-13-2012
Message 3 of 8 (1,954 Views)

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.

Occasional Visitor
akaiser2222
Posts: 1
Registered: ‎03-15-2012
Message 4 of 8 (1,931 Views)

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

 

Valued Contributor
Anshoo_Arora
Posts: 82
Registered: ‎07-06-2011
Message 5 of 8 (1,918 Views)

Re: QTP 11 Firefox Javascript Alerts

[ Edited ]

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
Valued Contributor
Anshoo_Arora
Posts: 82
Registered: ‎07-06-2011
Message 6 of 8 (1,913 Views)

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
Occasional Visitor
Faz Raja
Posts: 3
Registered: ‎06-12-2007
Message 7 of 8 (1,226 Views)

Re: QTP 11 Firefox Javascript Alerts

[ Edited ]

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"

 

 

Occasional Visitor
Manuel_Mejia
Posts: 1
Registered: ‎12-06-2013
Message 8 of 8 (884 Views)

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

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.