Automation Testing

QTP Difference in Behavior When Running Against IE vs Firefox

By Test Guild
  • Share:
Join the Guild for FREE

IE vs. Firefox

If you've done any type of web development for browsers in the past, I'm sure I don't have to tell you how frustrating the differences between browser types can be. Unfortunately, having to automate different browser types is no exception.

With the release of patch QTPWEB_00090, QTPWEB_00092 , and QTPWEB_00100, QuickTest Professional now supports testing web applications in Firefox browsers. There are differences, however, in the ways in which QTP interacts with the two browsers that you should be aware of.

WebButton Differences

When recording against IE on a WebButton, the default “Type” property value is Button. Against Firefox, however, the default value is Submit. To avoid issues, be sure not to use the Type property in your object repository or programmatic description to identify a webbutton test object.

DOM Differences

The Document Object Model (DOM) used for Internet Explorer is different than the one used by FireFox. That means that if you're writing scripts that need to interact directly with DOM statements, you have to bake in logic to handle both. To find out more, check out:

  • IE – About the DHTML Object Model
  • FireFox – Mozilla Developer Network – Document Object Model

Dialog Boxes

That's right – and how annoying is this? – but IE and Firefox use different dialogs. For example, Firefox 3.x and below will show a security dialog with a different format than IE:


What's even crazier is that the newer versions of Firefox's dialogs are also different from older versions of Firefox. Luckily for new Firefox releases, however, QTP has two new Firefox dialog-related methods: HandleDialog and GetDialogText.

HandleDialog and GetDialogText

Both methods can be accessed from the Browser object and enable you to perform actions against browser dialog boxes that were opened from HTML content:

  • HandleDialog – This method clicks a button on a browser dialog box such as an alert, confirmation or prompt:
    • Browser(“Browser”).HandleDialog micOK
  • GetDialogText – This method retrieves the text displayed in a browser dialog box:
    • browserText = Browser(“Browser”).GetDialogText

(These methods only work with Mozilla FireFox 4 or higher, and you'll need to have the latest FireFox patches installed.)

Recovery scenarios

Because of the difference in standard dialog boxes described above, if you're using pop-up recovery scenarios that use the Click button against Dialogs, you're basically screwed. Recovery operations that were built for Microsoft Internet Explorer will not work for Firefox!

Firefox menus and sidebars

QuickTest Pro does not support Firefox menus or sidebars. The only toolbar buttons it supports are the following:

  • Home
  • Refresh
  • Back
  • Forward
  • Stop

Known QTP 10 FireFox limitations

QTP 10's recording feature is not supported against Firefox.

The Object property is not supported in QTP 10 and older versions.

As far as possible problems with QTP or Firefox go, the preceding are all that come to mind at present.

If you know of or experience any other issues, please let me know!

 

A bearded man with blue glasses and a black-and-white jacket smiles at a microphone in a studio setting.

About Joe Colantonio

Joe Colantonio is the founder of TestGuild, an industry-leading platform for automation testing and software testing tools. With over 25 years of hands-on experience, he has worked with top enterprise companies, helped develop early test automation tools and frameworks, and runs the largest online automation testing conference, Automation Guild.

Joe is also the author of Automation Awesomeness: 260 Actionable Affirmations To Improve Your QA & Automation Testing Skills and the host of the TestGuild podcast, which he has released weekly since 2014, making it the longest-running podcast dedicated to automation testing. Over the years, he has interviewed top thought leaders in DevOps, AI-driven test automation, and software quality, shaping the conversation in the industry.

With a reach of over 400,000 across his YouTube channel, LinkedIn, email list, and other social channels, Joe’s insights impact thousands of testers and engineers worldwide.

He has worked with some of the top companies in software testing and automation, including Tricentis, Keysight, Applitools, and BrowserStack, as sponsors and partners, helping them connect with the right audience in the automation testing space.

Follow him on LinkedIn or check out more at TestGuild.com.

  1. How to use script for check exist dialog box on Firefox browser before use GetDialogText command

    Thank you

  2. juckrid » Hi – your could create a function that checks for dialog text if it find it do something. For example:

    Function Dialog_Exist()
    ‘Next sentence will handle QTP error message
    On error resume next
    ‘Save normal reporter value.
    x = Reporter.Filter
    ‘Instruct QTP to avoid reporting any error to the Test Results
    Reporter.Filter =3
    ‘If the following sentence raises the error, then there is not a Dialog displayed.
    doesExist = Browser(“YourBrowser”).GetDialogText
    ‘Validate the error number. Zero means that there are no errors
    If err.number <> 0 Then
    Dialog_Exist = false
    else
    Dialog_Exist = true
    End If
    ‘Set Reporter.Filter to default value
    Reporter.Filter = x
    ‘Instruct QTP to show error messages if necessary (as it does normally)
    On error goto 0
    End Function

    If Browser(“YourBrowser”).DialogExist Then
    ‘Add your dialog code
    End If

  3. Joe,

    Thanks a ton for writing about ‘HandleDialog’, learning about that was really helpful. Apparently I missed that in one of the readmes for all these patches and it’s certainly not in the QTP Help file. One thing to note is that ‘HandleDialog’ does not seem to work (for me) on the dialog that pops up when you click on a link to a PDF file. Not sure why, but no matter what I try, I get a Runtime error that simply says “The operation cannot be performed”. QTP sees the dialog, can Activate it, but can’t use the HandleDialog method for whatever reason. For now, until I can figure out why HandleDialog isn’t working, I’ll just have to use .Type micReturn and assume that the OK button will always be the default.

  4. Joel » Hi Joel – not sure why this is happening. I will try to reproduce on my machine this week. I’ll let you know what I find. What version of FireFox are you using and what OS? Cheers~Joe

  5. Hey Joe, thanks for responding and sorry for my delayed response. I’m using FireFox 12, latest version of QTP with all applicable patches and Win 7 64 bit. Anything you find would be awesome and if I come up with anything I’ll make sure to come back and update. Thanks!

  6. Hi Joe, may I know on what browsers QTP supports recording feature? do we have any table with the list of browsers supporting recording/run features.

    Thank you

  7. Hi Joe and Joel,

    Do you Guys found any resolution for above issue mentioned by joel, me too facing the same issue and have been trying to find out work around .. but not yet succeeded.. it would be great help if you share the resolution for this..

    Thanks a ton!! in advance.

  8. Hello Joe,

    I have a problem with QTP11, when I start to record and opens the website, not visible option menu of the page, this only when I’m recording, but I open the page without qtp opens normally I have java installed addins and web, IE8, Win XP.

    Hopefully you can help me.

    Greetings.

  9. adrian » Hi – Sorry not sure I understand your issue. What is the behavior? You are trying to record against a web site and the option menu page is not visible – is option menu the name of a page in your application?

  10. Hi,

    1) I have installed Firefox 12.
    2) I have installed patches QTPWEB_00090, QTPWEB_00092 and QTPWEB_00100.
    3) I registered firefox to QTP11.
    4) In firefox extensions the QTP plugin got enabled.
    5) I am able to record and run scripts on Firefox.
    6) However, when I am running my existing scripts which is a windows application, its not recognizing the objects.
    7)Before installation of Firefox patches it used to run well.

    When I uninstalled the patches it is recgnizing the windows app again.

    Please adive.

  11. Hi Joe,

    Can you share a sample on how you’ll code your Recovery Scenario to handle both IE and Firefox?

    Thank you very much!

  12. Hi Gilber – Because of the difference in standard dialog boxes described above, if you’re using pop-up recovery scenarios that use the Click button against Dialogs, you’re basically screwed. Recovery operations that were built for Microsoft Internet Explorer will not work for Firefox :(

  13. Hi Joe,

    I have QTP 11.0 and Firefox 17.0.4 installed. I am able to identify the objects successfully. But the problem I am facing is I am not getting the methods HandleDialog and GetDialogText under Browser(…).

Comments are closed.

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

5 Top Model Context Protocol Automation Tools (MCP Guide 2025)

Posted on 04/09/2025

What is Model Context Protocol (MCP) Model Context Protocol (MCP) is an open ...

What is TDD (Test Driven Development)

Posted on 04/05/2025

What is Test-Driven Development (TDD)? Test-Driven Development is a software development approach that ...

The Best Open Source API Testing Tools for 2025

Posted on 04/01/2025

Here is my list of the best open source API testing tools for ...