HP UFT/QTP vs. Selenium – Automated Test Tool Comparison

HP Quick Test Pro, also known as HP Unified Functional Testing, is currently a well-known force in the web-based testing market, but Selenium is quickly gaining mindshare and advocates as a more capable, open-source competitor. There are several clear-cut distinctions between each test tool that should make choosing one or the other a straightforward decision in most cases.

Comparison Highlights Between QTP and Selenium

Cost – QTP requires a license fee for acquisition and more fees for upgrades and add-ons, but Selenium is a totally free, open-source download and will always be so.

Testing Applicability – Selenium is only for testing web-based apps, whereas QTP can test client-server and desktop applications in addition to web-based apps.

Cloud Ready – QTP’s one-script/one-machine execution model cannot make efficient use of distributed test execution via cloud-based infrastructure. Selenium-Grid is specifically designed to run simultaneous tests on different machines using different browsers and different operating systems in parallel. Thus, it is a perfect match for cloud-based testing architectures and services.

Execution Efficiency – QTP tests one application per machine, whereas Selenium can execute multiple, simultaneous tests on a single machine. Furthermore, QTP script execution takes more RAM and CPU power than does Selenium. QTP can run in multiple Windows VMs, but these are more resource-hungry than Linux VMs, which Selenium can utilize.

Browser Compatibility – QTP works with four browsers, albeit some of the most popular ones, whereas Selenium works with those plus five more browsers of which two are headless. Headless browsers provide additional test execution efficiency.

Language Compatibility – QTP tests are written in Microsoft’s VB Script. Selenium tests can be written in one of nine different popular languages including Java, JavaScript, Perl, Python and PHP. Thus, you can adapt it to the programming resources you have on hand.

OS Compatibility – Selenium tests applications on all major OSs including Windows, Linux, OS X, Solaris, iOS and Android. QTP runs only on Windows.

Support – Selenium is supported by a vibrant, active user community, but it does not have dedicated support staff, whereas you can buy technical support for QTP. For some issues, paid support provides faster resolution cycles.

Technical Challenges When Using Selenium

Although Selenium has a number of meaningful advantages over QTP, including its much broader compatibility with different app and test configurations, it is not without technical limitations:

  • Selenium is not uniformly compatible across browsers. It is most compatible with Firefox, so scripts developed for Firefox may need tweaking to run in IE or Chrome.
  • It has no object types other than WebElement or Select, and no repository for storing object mappings.
  • There is no inherent support for data-driven testing.
  • HTML tables and other elements require coding to work correctly.
  • Image-based tests are harder to accomplish.
  • Dialog box support is limited.
  • In general, Selenium requires a higher level of coding skills

Some of these issues are resolved via testing frameworks compatible with Selenium. However, these may add upfront development effort when developing or integrating with such a framework.

Tips on Migrating from QTP to Selenium

When migrating from QTP to Selenium, take a piecemeal, trial approach to get started. Choose a script language with which the team has the most experience already, or one that best supports the type of automation framework you plan to build.

However, at the beginning, defer building a framework and simply write a handful of simple Selenium scripts. Collect notes about issues as you go along. Incorporated those learnings into building larger test suites. It is easier to write Selenium scripts from scratch than trying to port them directly because of the many differences between QTP and Selenium.

Once you become familiar with Selenium and commence building an automation framework, look at tools that play well with Selenium such as Maven for compilation, Test NG to drive unit, functional and integration tests and Jenkins or Hudson if you plan to use a Continuous Integration methodology.

If your web-based automation test projects require the highest flexibility across browsers, OSs and script languages at the lowest cost, then Selenium is the clear winner. However, especially in the earliest stages of adoption, more skilled programming resources are required for script generation and integration into an automation framework of your choice.

The many pros and cons between QTP and Selenium may present difficult choices if you currently use QTP, but otherwise Selenium provides the better payback and versatility over the medium-term.