Dialog box on different browsers.
Question ID: 104418
2
0

I am trying to create a script to test on different browsers (Internet Explorer, Firefox, and Google Chrome). The new patch QTPWeb_00088 allows QTP 11 to run scripts on Google Chrome however for some reason dialog boxes are not the same. Does anybody have an example how to get my test to work?

Marked as spam
Posted by (Questions: 45, Answers: 1)
Asked on November 29, 2011 10:05 am
96 views
Answers (4)
2
Private answer

I have been able to reproduce this issue with the site [W3School.com][1]
and this code. This sample script was recording using QTP 11 and Internet Explorer browser.


Browser(''zz'').Page(''P'').Sync
Browser(''zz'').Navigate ''http://www.w3schools.com/js/tryit.asp?filename=tryjs_alert''
Browser(''zz'').Page(''Tryit Editor v1.5'').Frame(''view'').WebButton(''Show alert box'').Click
Browser(''zz'').Dialog(''Message from webpage'').WinButton(''OK'').Click

Here are some facts about different browsers and how they handle dialog boxes.

* Internet Explorer (IE9) uses Microsoft windows dialog boxes with windows buttons.
* Firefox (3.6) uses Microsoft windows dialog boxes with child web page with web buttons.
* Google Chrome uses a custom window control (Chrome_Widget)

HP does not state that the dialog boxes should or should not work the same across browsers. Since each browser has a different implemented of the dialog boxes I think it would be difficult HP to translate each for coding. Recommend writing function code to deal with each unique browser dialog box environment. Below is an example code I used for the above code


Browser(''zz'').Page(''P'').Sync
Browser(''zz'').Navigate ''http://www.w3schools.com/js/tryit.asp?filename=tryjs_alert''
Browser(''zz'').Page(''Tryit Editor v1.5'').Frame(''view'').WebButton(''Show alert box'').Click

tempVar =Browser(''zz'').GetROProperty(''application version'')
Select Case tempVar

Case  ''Chrome 15.0''
     msgbox ''Chrome''
     Window(''Google Chrome'').Window(''The page at www.w3schools.com'').ClickOnText  ''OK''

Case ''Mozilla Firefox 3.6.17''
   msgbox ''Firefox''
   Browser(''zz'').Dialog(''The page at http://www.w3schoo'').Page(''The page at http://www.w3schoo'').WebButton(''OK'').Click

Case ''internet explorer 9''
     msgbox ''internet explorer 9''
    Browser(''zz'').Dialog(''Message from webpage'').WinButton(''OK'').Click

Case else
          Msgbox ''nothing'' &tempVar
End Select

*Note: Above code is only for an example and tempVar will have be be changed to only get correct browser*

[1]: http://www.w3schools.com/js/tryit.asp?filename=tryjs_alert9595-

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on November 29, 2011 10:25 am
0
Private answer

I am also facing the same above issue in IE7 and IE9 browser.
Dialog box differs on different browsers version (IE7 and IE9) for same application. Please suggest me how to handle this issue. As I need to run the script in different browser version. It's hard to use separate script for different browser version.

IE7 browser - Browser("xxxxx").Dialog("Windows Internet Explorer").WinButton("OK").Click
IE9 browser - Browser("XXXXX").Dialog("Message from webpage").WinButton("OK").Click

Marked as spam
Posted by (Questions: 0, Answers: 1)
Answered on December 7, 2012 6:57 am
0
Private answer

This example is good, but i think there is no method called ClickonText for Window (which was mentioned under Chrome case, please relook)

Marked as spam
Posted by (Questions: 0, Answers: 3)
Answered on June 18, 2012 1:17 pm
0
ClickonText is a method that is not published in documents and is not guaranty but does work.
( at December 10, 2012 12:42 pm)
0
Private answer

Just want to give some more update:
Now to work with Chrome19, we need to install QTPWEB_0090 first then QTPWEB_00102, this works very well.

Marked as spam
Posted by (Questions: 0, Answers: 3)
Answered on June 18, 2012 1:19 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top