How to use Same QTP Scripts for IE 6, IE 7 and Firefox 2.0 / QTP scripts Browser compatibility

Posted on 2008-11-05
Last Modified: 2013-12-08
I have working QTP 9.2 scripts on Internet Explorer 6.0 for an web application. And I would like to use same scripts to execute on Internet Explorer 7.0 and Mozilla Firefox 2.0. So, in order to do that I created a global action, which is similar to following that one.  I am getting objects are not found in the object repository.
So, how can add browser identification objects to object repository?
And what are the steps to take to execute same QTP Scripts for IE 6, IE 7 and Firefox 2.0?

Now I am using QTP 9.5 version. So, my intension is based on browser I would like to set some objects to browser specific . It would be great, if someone could help me in this regard.


if(Window("Microsoft Internet Explorer").Exist) then
' for Internet Explorer 6.0

      Browser("Default Details").Dialog("Microsoft Internet Explorer").WinButton("OK").Click

'elseif (Window("Windows  Internet Explorer").Exist) then

'for Internet Explorer 7.0

   Browser("Default Details").Dialog("Windows Internet Explorer").WinButton("OK").Click


'for Mozilla Firefox related

'Browser("Default Details").Dialog("Mozilla Firefox").WinButton("OK").Click


Question by:Rajavar
    LVL 9

    Accepted Solution

    You can run the same script of a web App on different browsers with some limitations.
    1) You can run the script prepared for IE browser on Firefox.
    2)For running the scripts on other browsers than IE you have prepare the script in IE and run them in other browsers becuase you cannot record script in Fire fox.
    3)The script may fail if it has any webpage dialogs becuase in IE the dialog is recognized as Window where as in FIREFOX the webdialog is recognized as Dialog this is the only difference we have with IE and FIREFOX.

    4) Your script may fail with IE7 if it is prepared aginst IE6 because of the object identiofication for resolving this remove the Object name property in the object repository.

    but anyway you can try to do that
    You can change the record and run setting to run the script in different browsers.
    Even you can record also on different browser

    Plz check the attached image.
    you can open this window from qtp, using
    QTP>Automation>Record and Run Settings

    Author Comment

    First of all thanks for your response.
    I Created Alert_Dialog_Title_Check golabl action to pass Dialog errors on IE 6, IE 7 and Firefox 2.0. And the script is as follows:

    If( Browser("Browser Details").Dialog("Microsoft Internet Explorer").exist) then
       ' For Internet Explorer 6.0
     Browser("Browser Details").Dialog("Microsoft Internet Explorer").WinButton("OK").Activate
       Browser("Browser Details").Dialog("Microsoft Internet Explorer").WinButton("OK").Click
    elseif (Browser("Browser Details").Dialog("Windows Internet Explorer").Exist) then

      'For Internet Explorer 7.0
      Browser("Browser Details").Dialog("Windows Internet Explorer").WinButton("OK").Activate
       Browser("Browser Details").Dialog("Windows Internet Explorer").WinButton("OK").Click


    'For Firefox 2.0
      Browser("Browser Details").Dialog("The page at says:").Activate
      Browser("Browser Details").Dialog("The page at says:").WinButton("OK").Click
    end if

    The above script is working for IE 6 and IE 7 to pass Dialog errors. But it is failed to pass on Firefox 2.0.
    And getting object not found errors. Even add the objects also, run time it is not identifying.

    So, my question is, please provide a common action script for Alert Dialgog boxes checking on IE 6, IE 7 and Firefox 2.0

    Help wpuld be appreciated.
    LVL 1

    Expert Comment

    What objects are not recognized on FF2.0? Is it the Browser object or any of his descendants?

    Author Closing Comment

    I left the Organization, where I needed the solution for this question and hence did not do followup about this problem.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    One of the most important skills a software quality assurance engineer can possess is the ability to write clear and concise test case descriptions. Regardless of whether the test case is to be executed programmatically or manually, a well written d…
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
    Shows how to create a shortcut to site-search Experts Exchange using Google in the Chrome browser. This eliminates the need to type out whenever you want to search the site. Launch the Search Engine Menu: In chrome, via you…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now