CSC/ECE 517 Fall 2014/ch1a 22 as: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 53: Line 53:
HP UFT's VBScript allows for classes, but not other object oriented properties such as inheritance and polymorphism. It also lacks a debugger, however UFT has a debugger provided by HP. Some Windows script ([http://en.wikipedia.org/wiki/Windows_Script_Host WScript],[http://en.wikipedia.org/wiki/WSH WSH],[http://en.wikipedia.org/wiki/Wmii WMI]) & [http://en.wikipedia.org/wiki/Visual_Basic_.NET VB.Net] code can be used in a script in the expert view  <ref>https://h20546.www2.hp.com/main/training/course_details.cfm?Course=00008165&sitepick=US</ref>
HP UFT's VBScript allows for classes, but not other object oriented properties such as inheritance and polymorphism. It also lacks a debugger, however UFT has a debugger provided by HP. Some Windows script ([http://en.wikipedia.org/wiki/Windows_Script_Host WScript],[http://en.wikipedia.org/wiki/WSH WSH],[http://en.wikipedia.org/wiki/Wmii WMI]) & [http://en.wikipedia.org/wiki/Visual_Basic_.NET VB.Net] code can be used in a script in the expert view  <ref>https://h20546.www2.hp.com/main/training/course_details.cfm?Course=00008165&sitepick=US</ref>


===Example===
QTP script for opening a Notepad file<ref>http://kuldeepse.wordpress.com/2007/11/11/qtp-script-for-sending-a-mail-using-outlook/</ref>.
<pre>invokeapplication”c:/whatever the path”
Run
Dim a
Set a = WScript.CreateObject (“WSCript.shell”)
a.run “notepad.exe”
Dim oShell
Set oShell = CreateObject (“WSCript.shell”)
oShell.run “cmd/notepad.exe”
Set oShell = Nothing
DsystemUtil.Run “Notepad.exe”
</pre>
===Exception handling===
===Exception handling===
Application crashes, Unexpected events and errors during a run session can interrupt the run session and mislead results. This is a problem particularly when tests run unattended—the test pauses until one performs the operation needed to recover. To handle these situations, Exception Handling and Error handling is must while developing script or Automation Framework.<ref>http://qtpautomationcodes.blogspot.com/2013/05/error-handling-in-qtp.html</ref>
Application crashes, Unexpected events and errors during a run session can interrupt the run session and mislead results. This is a problem particularly when tests run unattended—the test pauses until one performs the operation needed to recover. To handle these situations, Exception Handling and Error handling is must while developing script or Automation Framework.<ref>http://qtpautomationcodes.blogspot.com/2013/05/error-handling-in-qtp.html</ref>

Revision as of 08:56, 25 September 2014

HP Unified Functional Testing Professional

HP Unified Functional Testing (UFT) software, previously known as HP Quick Test Professional (QTP),<ref>http://www.automationrepository.com/2012/12/hp-unified-functional-testing-uft-11-5-new-features</ref> provides functional testing and regression testing automation for software applications.<ref>http://www8.hp.com/us/en/software-solutions/application-lifecycle-management-application-test-software/index.html?zn=bto&cp=1-11-127-24^1352_4000_1__</ref> HP Unified Functional Testing can be used for enterprise quality assurance.<ref>http://www.learnqtp.com/qtp-quality-center-test-director-guide/</ref> HP Unified Functional Testing is a test automation tool originally developed by Mercury Interactive and later acquired by Hewlett Packard.<ref> http://www.devbistro.com/articles/Testing/Mercury-QuickTest-Professional-Evaluation</ref> HP Unified Functional Testing 11.5 combined HP QuickTest Professional and HP Service Test into a single software package,<ref> http://selftechy.com/2013/10/07/hp-uft-11-50-unified-functional-testing</ref> which is currently available from the HP Software Division. The integrated HP Unified Functional Testing software allows developers to test from a single console all three layers of a program’s operations: the interface, the service layer and the database layer.<ref>http://www.computerworld.com/article/2493313/data-center/hp-simplifies-automated-software-testing-suite.html</ref>

Writeup page.

HP Uniffied Functional Testing<ref>http://en.wikipedia.org/wiki/HP_QuickTest_Professional</ref>
Developer(s) HP, HP Software Division
Stable release 12.01
Operating system Microsoft Windows
Type Test automation tools
License Proprietary

Background

Test automation is the use of software to control the execution of tests cases, the comparison of actual to predicted results, the setting up of test preconditions, and other test control and test reporting functions.<ref>The Testing Network, An Integral Approach to Test Activities in Large Software Projects by Jean-Jacques Pierre Henry (Aug 17, 2008), p413, ISBN 978-3-540-78504-0</ref> Test Automation is a development discipline as it uses scripting languages to instruct the tool how to interact with your application. As such careful consideration needs to be paid to

  • Exception handling for bugs that occur during testing cycles(i.e, unexpected error messages during a test run).
  • How the tool synchronizes with your application(e.g. if there are slow response times from your environment)
  • The level of maintenance required to keep the tests up to date with changes in the application GUI(i.e, new buttons, data fields, custom controls etc)

Any test automation framework is a set of assumptions, concepts and tools that provide support for automating the major activities in the testing process. The main advantage of a framework is

  • Increased Productivity
  • Easy and Reduced maintenance effort
  • Consistent automation development across projects
  • Process driven than person driven approach
  • Controlled maintenance of automation artifacts

There is a range of automation testing tools available. Some of them are licensed and few others are open sourced. QTP, Cucumber, Capybara and other tools<ref>http://en.wikipedia.org/wiki/List_of_web_testing_tools</ref>

Description

Although HP UFT is generally used for GUI based Test Case Automation, it can also automate some non-GUI based test cases like database testing, webservice testing and file based operations. It offers a graphical user interface, keyboard support, multiple testing views, and scripting language. <ref>http://www.softwaretestinghelp.com/qtp-quicktest-professional-tutorial-1/</ref>

Data Driven Testing

HP Unified Functional Testing allows us to perform data-driven testing. For example, data can be output to a data table for reuse. Data-driven testing is implemented as a Microsoft Excel workbook, which is accessible from HP Unified Functional Testing. HP Unified Functional Testing has two data tables: the Global data sheet and Action (local) data sheets. The test steps can read data from these data tables in order to drive variable data into the application under test, and verify the expected result.<ref>http://www.qtp10.com/2009/07/using-global-and-action-data-sheets-in.html</ref>

Views

HP Unified Functional Testing provides two views—and ways to modify—a test script: Keyword View and Expert View. These views enable HP Unified Functional Testing to act as an Integrated Development Environment (IDE) for the test, and HP Unified Functional Testing includes many standard IDE features, such as breakpoints to pause a test at predetermined places.<ref>http://en.wikipedia.org/wiki/HP_QuickTest_Professional</ref>

Keyword view

Keyword View lets users create and view the steps of a test in a modular, table format. In Keyword View, users can also view properties for items such as checkpoints, output values, and actions, use conditional and loop statements, and insert breakpoints to assist in debugging a test.<ref>http://www.qtp10.com/2009/07/working-with-keyword-view-in-hp-qtp.html</ref>

Expert View

Expert view displays test code using VBScript. Designed for more advanced users, users can edit all test actions except for the root Global action, and changes are synchronized with the Keyword View.<ref>http://www.fdscallcentre.com/homepage/data/mi/DS-0413-020_QTPro6.0.pdf</ref>

Scripting

HP UFT's VBScript allows for classes, but not other object oriented properties such as inheritance and polymorphism. It also lacks a debugger, however UFT has a debugger provided by HP. Some Windows script (WScript,WSH,WMI) & VB.Net code can be used in a script in the expert view <ref>https://h20546.www2.hp.com/main/training/course_details.cfm?Course=00008165&sitepick=US</ref>

Example

QTP script for opening a Notepad file<ref>http://kuldeepse.wordpress.com/2007/11/11/qtp-script-for-sending-a-mail-using-outlook/</ref>.

invokeapplication”c:/whatever the path”
Run 
Dim a
Set a = WScript.CreateObject (“WSCript.shell”)
a.run “notepad.exe”

Dim oShell
Set oShell = CreateObject (“WSCript.shell”)
oShell.run “cmd/notepad.exe”
Set oShell = Nothing

DsystemUtil.Run “Notepad.exe”

Exception handling

Application crashes, Unexpected events and errors during a run session can interrupt the run session and mislead results. This is a problem particularly when tests run unattended—the test pauses until one performs the operation needed to recover. To handle these situations, Exception Handling and Error handling is must while developing script or Automation Framework.<ref>http://qtpautomationcodes.blogspot.com/2013/05/error-handling-in-qtp.html</ref> Error and Exception handling in HP UFT can be done by any of the following ways:

Life Cycle

A typical life cycle of HP UFT looks like this.

Comparison to other tools

Tools like Cucumber and Capybara run tests from the viewpoint of the user. Cucumber translates user stories into tests and Capybara simulates a user or web browser. Unified Functional Testing is used by programmers to preform specific test cases they code themselves.<ref>Engineering Long-Lasting Software: An Agile Approach Using SaaS and Cloud Computing, Beta Edition 0.9.0 by Armando Fox and David Patterson, August 23, 2012, p136, </ref>

Capybara talks to a website, just like a human would do (example: visit a url, click on the specific area of the sceen, input data and submit the form). It imitates user flow over website. Test cases in Capybara will look like this:<ref>http://stackoverflow.com/questions/15004918/cucumber-vs-capybara</ref>

describe "the signup process", :type => :feature do
  before :each do
    User.make(:email => 'user@example.com', :password => 'caplin')
  end
  it "signs me in" do
    visit '/sessions/new'
    within("#session") do
      fill_in 'Login', :with => 'user@example.com'
      fill_in 'Password', :with => 'password'
    end
    click_link 'Sign in'
    page.should have_content 'Success'
  end
end

Cucumber tests are very much human readable. Example:<ref>http://stackoverflow.com/questions/15004918/cucumber-vs-capybara</ref>

Scenario: Signup process
Given a user exists with email "user@example.com" and password "caplin"
When I try to login with "user@example.com" and "caplin"
Then I should be logged in successfully

Selenium is a tool for automating web applications for testing purposes.

Comparison of UFT with other tools<ref>http://www.aspiresys.com/WhitePapers/QTPvsSelenium.pdf</ref>

Feature UFT Selenium Cucumber/ Capybara
Windows (Non-browser)

based Application support

Yes No No
Environment Support Only Windows Windows , Linux , Solaris

OS X , Others

Windows , Linux , Solaris

OS X , Others

Windows (Non-browser)

based Application support

Yes No No
Software Cost License & Annual maintenance Fees Zero Zero
Coding Experience of

Engineer

Not Much Should be very good along with

technical capabilities of integrating different pieces of framework

Requires minimal use of Ruby programming
Script Creation Time Low High Medium
Hardware resource (CPU

+ RAM) consumption during script execution

High Low Low
Product Support Dedicate HP support along with

support forums

Open Source Community Open Source Community
Framework Easily integrated with HP Quality Center or HP ALM Selenium + Eclipse + Maven / ANT

+Jenkins / Hudson & its plugins / Cruise Control + TestNG + SVN

Ruby on Rails

Merb

Sinatra

Continuous Integration Possible through Quality Center

/ ALM or Jenkins

Possible through Jenkins / Hudson

/ Cruise Control

Possible through Rake, Ant, Maven and JUnit output

Disadvantages

UFT popularity is slowly shrinking.<ref>http://www.quora.com/Is-there-demand-for-QTP</ref> It is being used more for legacy applications.

People are moving away from UFT because of it's reactive approach of writing test automation. Testers write the scripts. With cucumber, capybara and selenium, automation test are joint effort between developers and the testers. The testers write the test cases in cucumber scenario format, then the developers write the steps definition. This way, everyone is contributing and everyone is reviewing the test cases. Cucumber code is readable and easy to understand.<ref>http://qastuffs.blogspot.com/2010_12_01_archive.html</ref>

Unified Functional Testing is developed mainly for Windows based systems and it relies on outdated Windows tools like VBXScript. Tests can not be run outside of the UFT environment nor are they compatible with all browser types.<ref>http://www8.hp.com/us/en/software-solutions/unified-functional-testing-automated-testing/demos-documents.html#!&pd1=1</ref>

References

<references/>