Tuesday, January 11, 2011

QTP For Beginners

for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

What is automation testing?
        Automation Testing involves automating a manual process already in place that uses a formalized testing process

        In simple words , Test automation is the use of software to control the execution of tests, the comparison of actual outcomes to predicted outcomes

        It is a process of writing a computer program to do testing that would otherwise need to be done manually. Once the testing has been automated, a large number of test cases can be validated quickly
        Purpose of automated testing
         To increase the flexibility of time and resources

         To avoid redundancy on test execution

         To increase test coverage

         Increasing the quality and reliability of the software
Manual Vs Automation Testing

             Manual Testing
            Automation Testing

         Execution/turnaround time is high
         High Execution efforts
         Quality of testing is dependent on
    human capability
         Coverage needs to be planned as per
    delivery timeline
         Costs is high in the long run
         Execution Reports generation is
   manual
         Evidence Capturing is done manually

         Execution/turnaround time is less
         Low Execution efforts
         Quality is assured and independent
   of human capability
         Greater Coverage possible due to
   fast turnaround / execution
         Cost effective in the long run
         Execution Reports generation is
   automated
         Evidence Capturing is done
   automatically

Automation Concepts
        How is automation testing cost effective

        Some Good practices

        Do’s and Don’ts
Cost Effective Automation Testing
        Automation testing is expensive as there is an initial effort in building test scripts

        It follows the write-once-use-multiple-times analogy .Once the scripts are ready they can be used across multiple releases

        It does not replace the need for manual testing or enable you to "down-size" your testing department. Automated testing is an addition to your testing process

        It can take between 3 to 10 times as long (or longer) to develop, verify, and document an automated test case than to create and execute a manual test case
        Logical Grouping of writing test cases
Some Good practices

        Reusability

        Parameterization

        Maintain Coding Standards

        User Friendly Execution Report
Do’s and Don'ts

        Choose a test tool that best fits the testing requirements of your organization or company

        Overly complex tests are often more trouble than they are worth to automate. Concentrate on automating the majority of your tests, which are probably fairly straightforward

        Only automate tests that are going to be repeated. One-time tests are not worth automating

        Avoid using "Record/Playback" as a method of automating testing. This method is fraught with problems, and is the most costly (time consuming) of all methods over the long term
Scope of Automation
        Use of automation in Sanity\Smoke testing
        When a build is received, a smoke test is run to ascertain if the build is stable and it can be considered for further testing
        A sanity test is a narrow regression test that focuses on one or a few areas of functionality

        Use of automation testing in regression test suite
        Regression testing is done to ensure that changes to software do not introduce new defects or unintended behavior in the application
        A technique used to reduce the risk associated with introducing change to an application

Automation Approach / Methodology    
        Methodology adopted
           Understand / Rationalize requirements
        Feasibility study and identify Test Suite (Functional Health check, Sanity)
        Identify appropriate tool for automation (QTP, Test Complete, Test Partner etc)
        Proof of Concept

           Estimate & Plan
        Prioritise requirements
        Estimate / Plan automation targets based on priority

           Design
        Identify and develop Automation framework (Modularised approach)
        Build Repositories and libraries

           Reusability & Parameterization
        Identify reusable components based on prerequisite & repetitive scenarios
        Taking Parameterization approach for different inputs like boundary conditions etc

Automation Approach / Methodology     ….contd
        Implement
        Build automation scripts based on Design
        Review Test automation scripts for functional correctness

           Maintenance
        Update impacted scripts as per MR scope
        Review and Test

           Transition
        Knowledge transfer and Train Testing team
        Handover automation scripts
Comparison of Automation Tools


Test Complete
Test Partner
QTP
Vendor
AutomatedQA
Compuware
HP
Cost
Licensing ranged from $999-$2999
$6100 (per concurrent user with maintenance)
$10K Seat License
Ease Of Use
Programming background is highly recommended
High End Options for Professional Testers
Good for beginners. However, Programming background is needed for advanced automation
User Community
Medium
Low
Biggest by far
Support
Excellent. AutomatedQA personnel  actively participates in QAForums
Medium.
Compuware personnel  actively participates in QAForums
Improving. Knowledge Base access is restricted to Paid subscribers




Test Complete
Test Partner
QTP
Scripting Languages
VBScript, Jscript, C# Script, C++ Script, Delphi Script
Microsoft Visual basic For Applications(VBA)
VBScript
Technology Supported
.Net,PowerBuilder,Java,C++
Web, .NET, Java, SAP, Oracle and many other distributed Windows-based applications.
Seibel,Java,j2ee,.Net,CRM,SAP, PeopleSoft, Web Services, Terminal Emulator,IE,NN,AOL,Oracle
Web Testing
Yes. IE, Firefox, Mozilla, Netscape Navigator
Yes. IE, Firefox
Yes. IE , Firefox,Netscape
Web Load/Performance Testing
Yes
No
No. This is Load Runner functionality

Test Complete
Test Partner
QTP
Version Control Integration
Yes
Yes
Via Quality Center only.
Descriptive Programming
Limited
Yes. Call as 'Raw Attach Names'.
Excellent
Test Management
Yes, Built In
Yes, Built In
No, Needs Quality Center








Introduction To QTP
        Developed by Mercury interactive now owned by HP
        Developed for web functionality
        QTP supports both web applications & windows applications
        QTP was developed in 2002
        It is primarily used for functional regression test automation
        Present version in the market is 10.00
        Test Script developed on VB Script
        QTP run on only windows platform not supporting UNIX, Linux etc
        QTP supported Technology
        .NET. J2EE, Main Frame, XML, Java, Delphi
        ERP   -> SAP, Seibel, People soft
Environment needs for QTP 9.2
        System Requirement : Equivalent to P3 and above

        Hardware Drive         : 250MB of Free Memory space

        RAM                          : 512MB

        OS                               : M/S windows 2000 server with 3-4 service pack
                                                  M/S windows XP with 1-2 SP
                                                  M/S windows 2003 with no service pack

        Web Browser             : MS Internet Explorer  5.5 and above
                                                  Netscape Navigator 6.11, 6.22, 6.23, 7.02, 7.1
                                                  AOL  8.0, 9.0
Add Ins for QTP
Technology supported by the QTP
By default there are three add Ins:

        ActiveX
        VB
        Web

Additional Add ins:
        Java
        Oracle
        People soft
        .NET
        Terminal Emulator (RTE)
        SAP
        Siebel  
        Delphi
Guidelines for Analog and Low level recording
        Use Analog Recording or Low Level Recording only when normal recording mode does not accurately record your operation


        Analog Recording and Low Level Recording require more disk space than normal recording mode


        You can switch to either Analog Recording or Low Level Recording in the middle of a recording session for specific steps


        After you record the necessary steps in Analog Recording or Low Level Recording, you can return to normal recording mode for the remainder of your recording session
           
Record & Play Myth
        The scripts resulting from this method contain hard-coded values which must change if anything at all changes in the application

        The costs associated with maintaining such scripts are astronomical, and unacceptable

        These scripts are not reliable, even if the application has not changed, and often fail on replay (pop-up windows, messages, and other things can happen that did not happen when the test was recorded)

        If the application changes, the test must be re-recorded
Reporting in QTP
        The Main purpose of Reporter.ReportEvent in QTP is it is a Reporting      Mechanism in QTP
        It means Reports an event to the test results
        Syntax:
     Reporter.ReportEvent EventStatus, ReportStepName, Details
     where EventStatus can be:
        0 or micPass: Causes the status of this step to be passed and sends the specified message to the report
        1 or micFail: Causes the status of this step to be failed and sends the specified message to the report. When this step runs, the test fails
        2 or micDone: Sends a message to the report without affecting the pass/fail status of the test
        3 or micWarning: Sends a warning message to the report, but does not cause the test to stop running, and does not affect the pass/fail status of the test
Reporting in QTP
        ReportStepName is name of step

        Details are the user defined details for the given step

        Example:
    Reporter.ReportEvent micPass, "Login Authorization", "The user-defined step passed"
Synchronization Points
        Synchronization point maintains the time coordination between testing process and your application process
        Used for time mapping between QTP and Application
        Quick Test waits a set time interval for an application to respond to input
        The DEFAULT wait interval is upto 20 seconds
        Types
       WAIT
       WAITPROPERTY
       EXIST
Synchronization Points Types
        Wait
            is used to instruct the QTP to wait the execution process based on the specified time     only but not on any condition.               
        Example:
     Wait (2)

        WaitProperty
     is used to instruct QTP to wait the execution process until it matches with the object property value based on the specified time.
        Syntax:
            object.WaitProperty (PropertyName, PropertyValue, [TimeOut])
        Example:
                   Wait up to 30 seconds for the string "Ready" to appear in the "Status" text control.
             Window("Test").Static("Status:").WaitProperty "text", "Ready", 30000

Synchronization Points Types
        Exist
     is used to instruct QTP to wait the execution process based on the specified time and returns Boolean value as per the object existence.
        Example:
                  Browser("Window_name").Exist
                  Or
                  Browser("Window_name").Exist(5)
Set  Actions as Reusable
Reusable Action Scripts
        After reusable actions are created, they can be called into a “Main Calling” test in three ways:   
                                                                                                                         
        Call to New Action
        Call to Copy of Action
        Call to Existing Action
Reusable Action Scripts
        Call to Copy of Action

        After calling the action (reusable or non reusable) you will be able to see the new action in the action flow
        Both actions will be different means the change in any of the action will not be reflected to the other action

        Call to Existing Action (reusable actions only)

        The action will be added as a External Action. And this will be read only action
        You will be able to see this in the test flow with name as Action Name [Test Name]

Reusable Action Scripts
You can do number of things with a reusable action, such as:
        Call it multiple times within a test
        Call it from other tests
        Insert a call to an external action (the action is inserted in read-only format)  as local editable copy
        Use the (read only) data from the original  action
        Insert copies of non-reusable actions into your test, but you cannot insert calls to non-reusable actions
I/O O/P Parameters to Actions
        Need for Parameterization
        To avoid hard coded values
        To run on multiple set of data      
             Eg. StepNoCounter
  
         To parameterize the
     Re-usable Actions
     In the Action Properties of
      the Re-usable Action provide
      an INPUT and a subsequent
      OUTPUT parameter as
      shown :          
I/O Parameters to Actions                        
        In the Main Action, when the call to that same Re-usable Action
      is given, we specify the Parameters that need to be passed
 
     RunAction “Re-usable_Action1", oneIteration,”StepNoCounter”,
                                                                  “ReturnStepNoCounter”

         Now ,in the Re-usable Action, following syntax is written
 
       intStepNoCounter= Parameter("StepNoCounter")

       Parameter("ReturnStepNoCounter")= intStepNoCounter   

Regular Expressions
        What is Regular Expression
      
        A regular expression is a string that describes or matches a set of
        strings. Special characters and sequences are used in writing
        patterns for regular expressions
Some Regular Expressions  

Expression
Char
Description
Period
.
Matches any single character
Asterisk
*
Matches zero to any number of occurrences of the preceding character
Plus
+
Matches one to any number of occurrences of the preceding character
Brackets
[A-Z][a-z]
Matches a range of characters

[0-9]
Matches a range of numbers

\w
Matches any alphanumeric character including underscore

\W
Matches any non-alphanumeric character
Digit
\d
Matches any digit

\d{4}
Matches exactly four digits

        Purpose

        To increase the flexibility and adaptability of your tests
        Enable QuickTest to identify objects and text strings with                varying  values

            Usage

        Defining the properties of an object
        The methods of an argument
        To parameterize a step
        Creating checkpoints with varying values
Shared Repository
        Disadvantages of Local Repository
  
           Non-sharable
           Each time adding the objects for the Test


           What is Shared Repository

         Storing all the objects in the test or component in a common (shared)
           object repository file that can be used among multiple tests

         This means that object information is kept in one central location

         When the objects in your application change, you can update them
           in one location for multiple actions in multiple tests
        Comparison between Local and Shared Repository

Local Repository
Shared Repository
          Each Action 1 OR
          For many Test OR
          New Object Repository for each
    action
          Existing or Specified for a Test
         The object is stored as a separate
   Test object in each action
   repository
         Does not need to add new object.
   It only refers that object
   description
         These are automatically updated
    with the test as a part of each
    action within the test in both
    Keyword and Expert view
         Save explicitly with .tsr extension
   

         Object Repository Manager 

       It manage all of the shared object repositories from a single, central location by

         Adding and defining objects
         Modifying objects and their descriptions
         Parameterize repositories

           Running a Test with Shared Repository 

         When you modify the name of an object in a shared repository, the name is
          automatically updated in all tests open on the same computer that use the
          object repository as soon as you make the change

Please Let me know if any question/suggestion
for Technical interviews:

http://no1tutorial.com/

learn step by step technologies:


http://no1tutorial.com/

No comments:

Post a Comment