qtp automation strategy and coding standards v0-3

Upload: anamul-haque

Post on 04-Jun-2018

232 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    1/42

    Table of Contents

    1. Introduction.......................................................................................................2

    2. The automation process...................................................................................3

    3. QTP Functional Testing Methodology..............................................................5

    4. Create Inrastructure.......................................................................................1!

    5. Functions "i#rary............................................................................................12

    $. %uild &utomated 'cripts.................................................................................15

    (. QTP ) Connection to Quality Centre..............................................................31

    *. Maintenance &pproach...................................................................................33

    +. ,oles - ,esponsi#ilities.................................................................................35

    1!. n/ironmental ,e0uirements.......................................................................3$

    11. lossary........................................................................................................3(

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    2/42

     

    1. Introduction

    1.1. Purpose

    This Strategy and Coding standards document serves as a high level plan that specifies the

    overall approach to Quick Test Professional (QTP) Automation. It is for use y oth IT and

    !usiness testing and re"uires a collaorative approach y all stakeholders.

    This document specifies ho# to convert the manual Test Cases (as detailed in Quality

    Centre (QC)) to automated tests in QTP.

    It #ill descrie the process of accessing manual Test Cases in Quality Centre$ generating a

    QTP script from Quality Centre and then maintaining that QTP script from #ithin QTP.

    It #ill document Quick Test Professional Coding Standards that #ill apply to QualityCentre Test cases and Quick Test Professional %unctions and &'ect epositorys. All test

    cases #ill e uilt using an Automated %unction !ased Testing *ethodology and y

    identifying tasks re"uired to uild an automated testing solution.

    This document is ased on the automation of the *ail edirection Service (*S) and the

    SAP %i+ed Assets scripts.

    1.2. Objectives

    The design of this document is aimed at an automated test engineer and any tester #ith asound understanding of test automation using the QTP tool.

    This document #ill identify ho# to create QTP testing infrastructure such as &'ect

    epository entries$ create QTP %unctions$ make test cases data independent y calling data

    creation scripts and the reuse of QTP infrastructure from other pro'ects.

    This document #ill detail the follo#ing steps,

    • !uilding infrastructure

    • unning different releases - QTP against code releases

    1.3. Intended Audience

    This material is intended to e a living document and delivered to,

    •  e# automated testing staff (as a training aid and on-the-'o first reference)/

    • All automated testing staff (e+perienced or other#ise as a reference0template for the

    setting up of an automated testing pro'ect)/ and

    • Completed pro'ects to e updated #ith appropriate kno#ledge.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    3/42

     

    2. The automation process

    The follo#ing sections descrie in detail the process re"uired to create automated scripts to

    regression test e+isting pro'ects #ith maintenance releases.

    2.1. Automation Worflo!

    The diagram aove depicts the process in #hich e+isting applications re"uire automation for

    regression testing.

    2.1.1. Pre"re#uisites for $TP Automation Process

    The follo#ing are pre-re"uisites or dependencies for QTP automation,

    • 1no#ledge and hands-on e+perience #ith the use of QTP/

    • Quality Centre (QC) and QTP installed and configured/

    • QC and QTP are integrated/

    • QTP Add-Ins are installed (if re"uired)/

    • QC user groups are defined and granted access to Quality Centre pro'ects/

    • The application or product is in a stale state/

    • Creation of ne# automated scripts re"uires e+isting manual test cases to have

     een e+ecuted successfully. This task is performed y the application tester or

     usiness representative and is performed prior to handover to QTP automation.

    • The manual test cases must have een e+ecuted successfully and that there are no

    other changes in the application. 2+isting automated scripts can e updated

    directly to reflect the changes as part of maintenance releases.

    • All test cases must start and end at the same point. This is normally the %irst

    screen of the application. This allo#s for test cases to e atched together into a

    test suite.

    • All environment$ soft#are or data tale changes must e advised to the automated

    testing team. There #ill potentially e an impact on the running of automated test

    cases #ith the introduction of these changes.

    • The test cases must not e data dependant. All data re"uired in the test case must

     e created in the test case. In the event that data cannot e created and the test

    case is data dependant$ the data must e ale to e restored$ or manipulated ack

    to the initial state after a test case updates the data. This then allo#s for any test

    case to e rerun at anytime

    Create

    Inrastructure

    ,eport on

    .2ecution ,esults%uild &utomated

    'cripts

    .2ecute

     &utomated 'cripts

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    4/42

     

    2+isting manual test cases e+ist in QC in the standard format (see the QC user guide)

    and a copy of the test case to e automated are placed in the regression folder alongside

    any e+isting automated scripts. efer to Section 3.4 for further information regarding

    *anual Test Cases.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    5/42

     

    3. $TP %unctional Testin& 'ethodolo&(

    2ach Test case is uilt using a series of Quick Test Professional %unctions. 2ach function

    e+ecutes Quick Test Professional code to input data onto a screen.

    2ach o'ect in the Quick Test Professional %unction resides in the &'ect epository$ thusallo#ing Quick Test Professional to identify all fields in the application.

    • 2ach test case uses functions. 2ach function is either an applet on a screen or a

    #hole screen depending on the amount of fields.

    • 2ach function is named A5T6Screen ame e.g. *S6Close6Application

    • 2very field0o'ect on the screen or applet must e learnt into the o'ect

    repository and renamed #here re"uired to a more meaningful screen name.

    • 2ach function lirary must reside as .vs file

    • All functions are accessile via the step generator.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    6/42

     

    %unction is placed into testcase via the step generator. The rc value is passed ack to Quality

    Centre via the eporter. eport2vent rc command. Quality Centre accepts 7 for a pass$ 4 for a fail

    and 8 as done. Al#ays try to pass 4 or 7.

     

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    7/42

     

    The testcase function call invokes the function as displayed aove. This is the actual vscipt that

    drives QTP. 2ach function uses a function template. 9efine in the function$ the variales to

    uni"uely identify the screen and any fields on the screen.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    8/42

     

    The function displayed aove selects links via a parameter link6name. The links have een learnt

    into the o'ect repository. otice the ro#ser$ page and frame name are the same as #hat has een

    learnt into the o'ect repository.

    3.1. Initial Condition

    Automated test scripts must egin from the same starting point. It is est practise to end all

    open ro#sers and start the Application under Test from the eginning. This ensures that

    all scripts can run ack to ack in an unattended atch mode.

    3.2. )tart *p )cript

    The start up script #ill copy all functions from the :A and load them on the C 9rive

    of the PC e+ecuting the test case. It #ill also uild the infrastructure liraries if they

    dont e+ist.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    9/42

     

    3.3. Test case %ailure + ,-ception condition handlin&

    All Quick Test Professional functions must use an e+ception handling frame#ork. This

    allo#s any Quick Test Professional function to fail$ report the failure and ackout of the

    application.

    The e+ception handling frame#ork is uilt y,

    An 2nvironment ;ariale set in the Quick Test Professional startup6script set as

    2;I&*2T(2>.

    The *S6:ogon function sets the 2;I&*2T(2.

    If any function has a failure y not finding the screen is should e on$ or any kno#n

    e+ception condition is triggered$ the 2. The

    application is shutdo#n and all functions in that testcase flush. The ne+t use of a

    *S6:ogon function #ill reset the 2.

    The follo#ing diagram demonstrates the e+ception handling process,

    The 2+ception6Cond if e"ual to ?> #ill run this function. &ther#ise thefunction

    #ill report that the testcase has flushed.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    10/42

     

    . Create Infrastructure

    Infrastructure liraries are created to store QTP functions$ utilities$ documentation and

    o'ect repository files

    The Infrastructure liraries are created for each release of the soft#are. 5nder each release

    folder (eg 2:8) the folders elo# must e+ist$ other#ise QTP #ill fail in the startup

    script.

    2+amples of the liraries for releases are as follo#s,

    BBC&P&9DBQSABEroupBQTP6*SB2:8B9ocumentation

    BBC&P&9DBQSABEroupBQTP6*SB2:8B%unctions

    BBC&P&9DBQSABEroupBQTP6*SB2:8Bepository

    BBC&P&9DBQSABEroupBQTP6*SB2:8BTestcase

    BBC&P&9DBQSABEroupBQTP6*SB2:8BT+tfiles

    BBC&P&9DBQSABEroupBQTP6*SB2:8B5tilities

    The follo#ing diagram displays the directory structure for the el8 liraries. They are as

    follo#s

    ,

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    11/42

     

    .1. /ibrar( 0efinitions for each elease

    The application under test must have a QTP release specific directory$ i.e. 2:44$ 2: 48

    and Sandpit

    2ach of the release directories hold release specific infrastructure code or release specificinfrastructure o'ects that QTP re"uires in order to run the application under test. Therefore

    the 2:44 functions folder #ill hold all functions that e+ecute on the el44 application

    code and the 2:48 functions folder #ill hold any ne# application screen functions and

    modified el44 functions.

    .2. )andpit /ibraries

    Sandpit liraries are for use on the test automators pc to develop or modify QTP code. !y

    saving in these liraries$ data is not over#ritten #ith the aseline code after a restart ofQTP.

    The sandpit liraries remain empty on the BBC&P&9DBQSA drive. The sandpit lirary

    on the C drive is #here changes can e made or ne# functions can e created. &nce tested$

    they can e appended to the end of the %unction or 5tility ;!S files on the

    BBC&P&9DBQSA drive under the appropriate elease %older.

    The function and utility Sandpit liraries must contain a template function. If not$ these

    liraries cannot e e+ecuted via an e+ecutefile command.

    .3. 0ocumentation

    The 9ocumentation directory holds Ford or 2+cel documents #hich reference the

    application.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    12/42

     

    . %unctions /ibrar(

    The %unctions :irary contains QTP functions. These are ased on one function per

    screen. This lirary is a se"uential file of all the QTP functions for that application release.

    As more than one soft#are release can e tested at any one time$ the QTP function lirary

    can e concatenated in QTP #ith as many prior function liraries as re"uired. Thefollo#ing sho#s a lirary concatenation of rel4$ rel48 and rel44

    Sandpit

    FunctionABC

    %unction92%

      2:48

      Function XYZ

    2:44

    %unction 48

    %unction D3

    FunctionABC

    The aove sho#s that Sandpit function %unctionA!C #ould e a modified version of

    2:44 %unction A!C and a ne# function function92% as the sandpit lirary #ould

    override the rel44 function lirary.

    As each application release gets tested$ only the ne# functions and functions that re"uire

    modification are held in the Sandpit function lirary. All %unctions that are not changed

    are still accessed via the concatenation of ne# and old release function liraries in the QTP

    Startup

    The QTP startup script #ill copy all availale elease folders to the C,9rive or 9,9rive of

    each test machine.

    At the end of each ;!S file$ an 2;I&*2T lirary variale #ill e used to load

    other liraries if re"uired.

    1eith to add more detail

    .1. %unction Creation

    Fhen creating a ne# function$ the follo#ing steps must e follo#ed,

    4. :earn &'ect epository entries into the BBC&P&9DBQSA drive &'ect epository.

    8. ename &'ect epository entries to meaningful names.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    13/42

     

    . Create function y copying the template function into your sandpit0function lirary

    D. Add the field names of the screen to the parameter list of the function.

    G. Add the ne# &'ect epository entry names into the function$ as AP6#eedit$

    AP6#elist$ etc. This #ill allo# the function to communicate to the o'ect repository

    and play data into each field

    3. Save the function and test change

    H. &nce satisfied that ne# function is ok$ append it to the BBhcoprodDB"sa drive functionlirary.

    .2. Object epositor(The &'ect epository lirary holds all the application o'ects for the application under test.

    This lirary is not concatenated as only one &'ect epository$ #ith the same entries in it$

    can e opened at any time.

    Fhen creating a ne# release of the &'ect epository$ a ?save as> must e done on the old

    &'ect epository to the ne# release lirary. Any suse"uent changes can then e done inthe ne# &'ect epository lirary.

    Fhen a QTP script is e+ecuted$ a copy of the &'ect epository is taken and saved to

    C,BApplicationBeleaseBepository. This is done to ensure no corruption occurs on the

    master that is held on the BBC&P&9DBQSA drive.

    If changes are re"uired$ they must e done directly to the BBC&P&9DBQSA drive copy of

    the o'ect repository. This is ecause #hen merging t#o o'ect repositories$ QTP sees like

    defined o'ects as the same.

    !y learning ne# o'ects into the BBC&P&9DBQSA drive &'ect epository a rename on

    o'ects can e done and the &'ect epository can e resaved onto the BBC&P&9DBQSAdrive. 2nsure that a ackup of the o'ect repository is done first. If the &'ect epository

    gets corrupted$ then QTP #ill not run.

    2.g. *S uses BBC&P&9DBQSABEroupBQTP6*SB2:8BepositoryB*S.tsr .The

    &'ect epository is copied from the

    BBC&P&9DBQSA,BEroupBQTP6*SB2:8BepositoryB*S.tsr folder #hen the test

    case starts to C,BEroupBQTP6*SB2:8BepositoryB*S.tsr.

    .2.1. Object epositor( amin& )tandards

    Any o'ect placed into the &'ect epository should e named according to the field name

    on a screen. As #e E5I entries #ill e captured as the html programming name$ rename

    this to an understandale name such as Customerame or CustomerPhoneumer. This

    #ill then mean the E5I entry is sho#n in functions and test scripts as something

    understandale. A E5I entry in the format %78f#fn is not acceptale.

    Any E5I entries that are non #e ased must also have an understandale name.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    14/42

     

    .3. Testcase %older  

    This lirary holds reusale actions that #e can use for data loading. i.e. creating a piece of

    data that #e can reuse in the test script later. Any data that is created must e saved as an

    2nvironment variale.

    This lirary also contains the startup script and template script.

    .. T-tfiles %older This lirary holds files that are created at run time. This can also e used for transient data

    that is used et#een test scripts. This practice is not recommended as test cases should e

    data independant.

    .. *tilities %older 

    This lirary holds non specific functions that can e used in any test script. %unctions may

    include reading and #riting from files$ utton press$ edit sets$ list selects etc.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    15/42

     

    4. 5uild Automated )cripts

    4.1. 'anual Test Cases

    2ach Test Case must e #ritten into Quality Centre. %rom Quality Centre$ login to your pro'ect and select the test case. The 9etails ta of Quality Centre descries the tests

    Purpose$ Test Conditions$ Pre re"uisites$ 9ependencies$ 2nvironments and post-test

    Cleanups.

    ;ie# your ‘manual’  steps y clicking on the ta$ Design Steps. 2nsure that manual Test

    Cases have een #ritten and e+ecuted #ithout error and are therefore verified as correct

    before automating.

    !efore any test case is automated it must pass the follo#ing criteria,

    2ach script has een #ritten so that each application screen in the test case flo# is ane# test step and each verification point is a ne# step.

    • Test cases are stand alone$ non data dependant$ logon to the application under test

    at the start and logoff or shutdo#n the application at the end of each test case.

    • All data re"uirements are defined in the details ta of Quality Centre.  

    Appendi+ A of this document contains e+amples of a #ell #ritten and a poorly #ritten

    test case.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    16/42

     

    4.2. 6enerate $TP )cript

    @ou can no# convert this manual Test Case in to a Quick Test Professional script. To do

    this$ click on the Generate Script  utton and select the QUICKTEST_TEST  option.

    Quality Centre has no# generated Quick Test Professional code and has attached it to this

    manual Test Case. This can e vie#ed y clicking on the ta Test Script . This generated

    code is nothing more than a series of comments and reporter events. The Quality Centre

    manual Test Case has een copied in to Quick Test Professional and each step has een

     placed in as comments.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    17/42

     

    4.3. 6enerated $TP )cript

    After generating a Quick Test Professional script from Quality Centre all the Step details

    are placed into comments in the Quick Test Professional script

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    18/42

     

    4.. Test )ettin&s and Options

    2ach ne# script re"uires test settings$ record and run settings$ associate repositories and

    options to e set.

    4..1. Test )ettin&s

    Click on %ile and select Settings. Click on un ta. 2nsure that un on all ro#s is

    selected. At field, Fhen error occurs during run session, select proceed to ne+t step.

    2nsure that the t#o tick o+es are also ticked.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    19/42

     

    Click on esources ta. Click on J to add resource lirary and utilities. 2nsure that

    functions are associated to local C,B or 9,B and that sandpit liraries are listed first.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    20/42

     

    4..2. ecord and un )ettin&s

    Select Automation$ then ecord and un Settings.

    Fhen using a Findo#s ased application$ set as per e+ample elo#,

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    21/42

     

    Fhen using SAP application$ set as per e+ample elo#,

    Fhen using a Fe application$ set as per elo#,

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    22/42

     

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    23/42

     

    4..3. Associate epositories

    In QTP$ click on esources and then select Associate epositories. Click on J to

    create repository association. Click on K to associate Action4.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    24/42

     

    4... Options

    Click on Tools$ select &ptions. Click on un ta. 2nsure un *ode is set to ormal.

    As displayed in diagram aove$ ensure the follo#ing are ticked,

    - ;ie# results #hen run session ends

    - Allo# other *ercury products to run tests and components

    - Save still image captures to results. Select %or errors from drop list

    4.. )tep 6enerator  All Quick Test Professional functions are #ritten and stored in :iraries and are added to

    the Step Eenerator (%H) in Quick Test Professional.

    To access these functions$ click on Insert$ then Select Step Eenerator or press %H from

    #ithin QTP.

    The functions have een sorted alphaetically to make it easier to find the function that

    matches your Application screen. &nce you have found the function that #ill perform the

    functionality matching the Application screen$ you can fill in the value column #ith

    appropriate arguments that #ill e set to the function.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    25/42

     

    2very parameter must have an argument value specified. The return value o+ needs to e

    ticked each time a ne# function call is set. Insert another step to e ticked as re"uired.

    Fhen creating a function you must enter data into every field of the function to verify it

    can run the function correctly.

    The return value (rc = return code) stores #hether the function has passed or failed. The

    rc is then passed to the report and decides #hether the particular step has passed or

    failed.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    26/42

     

    4.4. ,ditin& $TP )cripts

     o# edit and uild the Automated Test Script via Quick Test Professional. To make the

    script #orkale$ #e egin adding in to the Test Script the functions or Test conditions that

    #ill perform the automated tests$ thus uilding up a test scenario. The idea here is to

    match the manual Test Case steps to the appropriate Quick Test Professional %unction.

    2ach test case should have one or more Quick Test Professional functions per step. This

    function #ill relate to each screen of the tested application$ as per the Automated

    %unctional Testing *ethodology.

    The Automated %unctional Testing *ethodology gives the advantage of modular

     programming/ it enales an easy and fast #ay to create reusale test cases. &ther

    advantages of this methodology are$ ease of maintenance of scripts and aility to run

    scripts in any environment due to no data dependencies.

    2nsure that you add the follo#ing te+t at the top of the Quick Test Professional script toidentify #ho has #ritten the script and #hen,

    E.g. “# Revision istor!" $nitia% &ersion '()(*)(+ ,RS version -.-.*>

    @ou are no# ready to edit0create the Automated Test Script. To do this$ start up Quick

    Test Professional and access the test script that #as created in Quality Centre via the pen

    command. There are t#o areas #here Test Scripts can reside. They can reside #ithin

    Quality Centre or in the %ile System (PC or et#ork folders).

    If #e have created the Test Script via Quality Centre then the script #ill reside #ith in

    Quality Centre. Lust follo# the same path you used #hen accessing the *anual Test

    Script$ to find the Automated Test Script.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    27/42

     

    Select Test Script

    from QC.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    28/42

     

    4.7. $TP Add"InsFhen Quick Test Professional scripts are created from Quality Centre$ Quality Centre sets

    the script default addin setting to lank.

    &nce you have started up the Quick Test Professional script you have to add all the A//0

    ins for the application under test. To do this$ go to Fi%e ) 1est 2roperties3 and click onthe A//0ins ta. %rom here you can select all the add-ins that #ill e needed y clicking

    on appropriate items then pressing Enter.

    $f t4is is not /one$ Quick Test Professional #ill e forced to shutdo#n and the script #ill

    not run at all$ due to Fetest commands eing e+ecuted in the functions #hile the

    FeTest addins have not een started #hen Quick Test Professional is invoked. 

    Alternatively$ any add-ins can e selected during opening QTP application.

    Select add-ins here y clicking on

    appropriate item.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    29/42

     

    4.8. $TP Template )cript

    2ach test case #ill use a template script at the start. This script #ill copy all functions from

    the :A and load them on the C 9rive of the PC e+ecuting the test case. It #ill also uild

    the infrastructure liraries if they dont e+ist.

    It #ill then e+ecute a function.vs file so at run time these functions #ill override thefunction lirary associated at uild time.

    The template script #ill e administered y QSA.

    The location of the template is,

    BBhcoprodDBEroupB QTP6*SB2:8BTestcaseBActionTemplate.mst

    The PC that #ill e running the automated scripts #ill reference the aovementioned

    Action template. A copy of this template is placed in C,BProgram %ilesB*ercury

    InteractiveBQuickTest ProfessionalBdat

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    30/42

     

    4.9. Completed Testcase

    2ach test case should have one or more QTP functions per step. The function should pass a

    return code ack to the test case$ therefore allo#ing QTP to pass Quality Centre the step

    status.

    At the start of each test case$ pre re"uired data can e added. *ost pre re"uired data for*S can e created using a test case that uses variales$ e.g. first name and surname. A

    gloal variale is created #hich can e addressed any#here else in the test case.

    Any pre re"uired data scripts e+ist in QTP6*S0el80Testcases. These testcases are

    reusale actions. The line unAction denotes a called action.

    The tester should ensure they have a good understanding of #hat is availale. If ne# data

    scripts are re"uired$ it is est to model them off e+isting scripts.

    A test case #ill appear as per the follo#ing e+ample,

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    31/42

     

    7. $TP : Connection to $ualit( Centre

    7.1. Connection

    )erver Connection

    %rom Quick Test Professional$ select Tools/ Quality Centre Connection and on the

    Quality Centre Connection page enter the follo#ing,

    Server ur%" http,00postapps0"cin  Click  on utton Connect

    ,.&. Project Connection

    Domain" P&L2CTQC

    2ro5ect" *S

    6ser 7ame" QC6*S

    2ass8or/" Mpass#ordK Click  on utton Connect

    Other 

    econnect at startup, check this o+.

    Save pass#ord for reconnection on startup, check this o+.

    http://postapps/qcbinhttp://postapps/qcbin

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    32/42

     

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    33/42

     

    8. 'aintenance Approach

    To ensure that release changes of soft#are can e accommodated y QTP$ some tasks must

     e completed efore running any tests.

    8.1. e&ression Test Chan&es

    Fhen a ne# release of soft#are causes old functions to perform incorrectly$ changes

    need to e done to these functions and o'ect repositories to allo# for testing to

    continue. These changes may e due to a ne# screen$ a screen change or an o'ect eing

    seen differently in QTP$ e.g. a change in a utton name.

    8.2. e! Infrastructure

    Fhen uilding a ne# release of QTP Infrastructure$ the first thing to do is uild the

    infrastructure liraries as documented previously. This #ill give you the aility to make

    release dependant changes to old functions$ scripts and &'ect epositories in the ne#

    liraries.

    Copy the QC folder #ithin the pro'ect to a ne# version. This #ill allo# for test cases

    changes in the ne# version of the QC folder and also keep the old QC folder as is. This

    #ill allo# for easier reporting of the testing effort in the ne# release.

    8.2.1. 5uildin& a ne! $TP ,nvironment

    As each ne# release of soft#are is placed into an application testing environment$ the QTP

    environment #ill need to e updated to allo# for ne# functions$ and the aility to run

    regression tests against the old soft#are. The follo#ing tasks need to e performed to uild

    the environment,

    • The release specific infrastructure liraries must e created for the ne# release$ as

    documented earlier in Section D.

    • The &'ect epository for the current release must e ?saved as> into the ne#

    release epository folder 

    • The %unction :irary re"uires 'ust a comment in it$ so it does not appear as an

    empty file.

    • The C,BT2*PBQTP6Start65p.vs file must e modified #ith the correct version

    of the application you #ish to test #ith. 9epending on the elease or Pro'ect$ this

    is to e updated accordingly.

    &nce this is completed$ restart QTP and ensure you are ale to run a script through to

    completion. Any function changes can then e done y copying the function from the

     previous releases function lirary and placing it into the ne# function lirary. %rom

    this ne# function lirary$ you are then ale to make the appropriate changes.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    34/42

     

    The follo#ing steps outline the uild for ne# environment,

    4. &pen Findo#s e+plorer.

    8. &n net#ork BBhcoprodDB"sa$ open QTP6*S folder 

    . Create ne# folder e.g. 2:4 and then create folders as per previous release,

    - 9ocumentation (to e empty)

    - %unctions (to contain lank function.vs file)

    - epository (to contain empty repository file)

    - Testcase (Copy Startup and QTP Startup from previous release)

    - T+tfiles (to e empty)

    - 5tilities (to contain lank utilities.vs)

    D. ighlight the Testcase folder.

    - &pen up QTP Startup.vs. 5pdate release numer in path

    - &pen up Startup.vs. 5pdate 9im elease J4 (8) and Add elease (8)

    - Add evision comments. 5pdates to e made in ne# function.vs.

    http://smb//hcoprod4/qsahttp://smb//hcoprod4/qsa

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    35/42

     

    9. oles ; esponsibilities

    oles esponsibilities

     &utomation'pecialist

    Create Functions and esta#lish li#raries or ne or eisting proects

    Create automated tests

    "iaise ith ,egression Tester 

    Pro/ide training and assistance to &utomation Test &nalysts.

     &utomation Test &nalyst

    Create Functions and esta#lish li#raries or ne or eisting proects

    Create automated tests

    "iaise ith ,egression Tester 

    ,egression Tester  Create automated tests

    "iaise ith &utomation 'pecialist and Test &nalyst

    ,aise deects in Quality Centre

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    36/42

     

    1

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    37/42

     

    11. 6lossar(

    To find the meaning of #ords that are not included in this glossary$ try the PostIT

    Elossary.

    Click here to access the PostIT glossary

    1erm Description

    Q'& Quality 'otare &ssurance. This team is part o Integration and e/elopment 'er/icesand is responsi#le or specialist testing competencies and testing go/ernance.

    QC Quality Centre. This is a 6P sotare pac7age used to store test re0uirements8 testcases8 deects and test eecution results.

    QTP Quic7 Test Proessional. This is a 6P sotare product used to automate manual tests.

     &9T &pplication 9nder Test

    http://postnet/postnet/page/channel/articles/0,,a1800_b1181552,00.htmlhttp://postnet/postnet/page/channel/articles/0,,a1800_b1181552,00.html

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    38/42

     

    1est Case E9amp%es

    E9amp%e of goo/ test case :

    Create and Approve Standard Purchase &rder 

    Purpose,

    Create a Standard Purchase &rder for stock items.

    %or each item of the stock$ the re"uester is different.

    9ata e"uired,

    - Supplier 9etails

    - stock item numers

    - e"uester name and #here to deliver to

    Prere"uisites,

     one

    )teps= 

    Step7ame Description E9pecte/ Resu%t

    Step 4 :og into the %*IS Application.

    2nter your user name in the N5sernameN field.

    2nter your pass#ord in the NPass#ordN field.

    Click on the N:oginN utton.

    The ome page appears.

    Step 8 Select the NMagencyK Purchasing Super 5serN menu

    item.

    Then select NPurchase &rders - Purchase &rdersN

    menu item.

    The Purchase &rders #indo#

    appears.

    'tep 3 nter :'tandard Purchase ;rder: in the :Type: ield.nter the supplier name in the

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    39/42

     

    Step

    7ame

    Description E9pecte/ Resu%t

    'tep 5 In the "ine ta#8 enter :2: in the >um column o thesecond ro.nter :oods: in the :Type: ield.nter the item num#er ?e.g. 1!54*@ in the :Item: ield.

    nter 0uantity ?e.g. 5@ in the :Quantity: ield.nter the price o the item ?e.g. 1$@ in the :Price: ield.nter a uture date in the :Promised: ield.

     &ll the details appear in the secondro o the ta#le.

    'tep $ In the "ine ta#8 enter :3: in the >um column o the thirdro.nter :oods: in the :Type: ield.nter the item num#er ?e.g. 1!5$2@ in the :Item: ield.nter 0uantity ?e.g. 5@ in the :Quantity: ield.nter the price o the item ?e.g. 1(.5!@ in the :Price:ield.nter a uture date in the :Promised: ield.

     &ll the details appear in the third roo the ta#le.

    'tep ( Place your cursor in the item ield o line 1 and then clic7on the :'hipments: #utton.

    The 'hipments indo appearsdisplaying the details o the item.

    'tep * Clic7 on the :istri#utions: #utton. The istri#utions orm appears.

    'tep + nter the re0uester name in the :,e0uester: ield.nter the deli/er to name in the :eli/er=To: ield.nter the su# in/entory name in the :'u#in/entory: ield.'a/e your or7 #y clic7ing on the :'a/e: #utton on thetool#ar.

    Aour or7 is sa/ed. & note appearsad/ising you that your or7 is sa/ed.

    'tep 1! Close the istri#ution indo. The 'hipments indo appears.

    'tep 11 Close the 'hipments indo. The Purchase ;rders indoappears displaying your purchaseorder.

    'tep 12 Place your cursor in the item ield o line 2 and then clic7on the :'hipments: #utton.

    The 'hipments indo appears.

    'tep 13 Clic7 on the :istri#utions: #utton. The istri#utions indo appears

    'tep 14 nter the re0uester name in the :,e0uester: ield.nter the deli/er to name in the :eli/er=To: ield.nter the su# in/entory name in the :'u#in/entory: ield.'a/e your or7 #y clic7ing on the :'a/e: #utton on thetool#ar.

    Aour or7 is sa/ed. & note appearsad/ising you that your or7 is sa/ed.

    'tep 15 Close the istri#utions indo. The 'hipments indo appears.'tep 1$ Close the 'hipments indo. The Purchase ;rders indo

    appears displaying your purchaseorder.

    'tep 1( Place your cursor in the item ield o line 3 and then clic7on the :'hipments: #utton.

    The 'hipments indo appears.

    'tep 1* Clic7 on the :istri#utions: #utton. The istri#utions indo appears.

    'tep 1+ nter the re0uester name in the :,e0uester: ield.nter the deli/er to name in the :eli/er=To: ield.nter the su# in/entory name in the :'u#in/entory: ield.'a/e your or7 #y clic7ing on the :'a/e: #utton on the

    tool#ar.

    Aour or7 is sa/ed. & note appearsad/ising you that your or7 is sa/ed.

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    40/42

     

    Step

    7ame

    Description E9pecte/ Resu%t

    'tep 2! Close the istri#utions indo. The 'hipments indo appears.

    'tep 21 Close the 'hipments indo. The Purchase ;rders indoappears displaying your purchase

    order.

    'tep 22 Clic7 on the :&ppro/e...: #utton. The &ppro/e ocument indoappears.

    'tep 23 Chec7 the :'u#mit or appro/al: #o.Clic7 on the :;B: #utton.

    The Purchase ;rder indoappears. ,ecord the purchase ordernum#er.

    'tep 24 Close the application. &pplication shut don.

    E9amp%e of inade#uate test case :

    2%an"

    0escription= 2urpose"

    2rere;uisites"

    Data Re;uire/"

    e"uisitioning an asset re"uires the use of a specific account code

    (

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    41/42

     

    )tepame

    0escription ,-pected esult

    'tep 1 ?>ote nter an Internal ,e0uisition and &dd items tothe shopping cart@

    'tep 2 9se the Internet Procurement responsi#ility to log intoapplications

    'tep 3 >a/igation '6' Internet Procurement

    'tep 4 nter in 'earch Full Internal Catalogue ield.

    'tep 5 Press the #utton D;E

    'tep $ 'elect the lin7 :Clic7 here to select source:

    'tep ( nsure that the radio #utton or the Internal 'ource is selected8 and that the su#in/entory shos

    Item ound

    'tep * Press the #utton D&dd To CartE

    'tep + Press the #utton DGie Cart ad Chec7outE

    'tep 1! 'ystem displays the orm :'hopping Cart Contents:

    'tep 11 'elect DChec7outE #utton

    'tep 12 The TE

    'tep 22 :,e/ie Charge &ccounts: page is displayed

  • 8/13/2019 Qtp Automation Strategy and Coding Standards v0-3

    42/42

     

    )tepame

    0escription ,-pected esult

    'tep 23 Press the #utton Dedit "inesEClic7 on &ccounts = ,eturn

     & re0uisition re0uiring appro/alis created.

    'tep 24 otes and &ttachmentsTE

    'tep 2( ,e/ie appro/er list - enter ustiication and note to#uyer 

    'tep 2* The