Sie sind auf Seite 1von 24

Quick Test Professional

QTP Developed by Mercury Interactive It is a Functionality Testing Tool Versions of QTP are 6.0, 6. , !.0, !." It supports #lient server, $eb, %&P and Multi'edia tec(nologies suc( as V), V#**, +ava, Po$er )uilder, Delp(i, Dot ,et, Flas(, -.P, -eibel, /racle .pps, People -oft, Ter'inal %'ulator,0TM1 and 2M1. It records our business operations in V) -cript. Note: The Multimedia Add-in is not supported in QuickTest Professional 8.2.

Supported Environment:
Operating System: Windows 98 S ! Windows 2"""-Ser#ice Pack $ or Ser#ice Pack%! Windows &P-Ser#ice Pack ' or Ser#ice Pack 2! or Windows 2""$ Ser#er. Memory: '28 M( of )AM *or 8." and a+o#e 2,- M( of )AM Free Hard Disk Space: 2"" M( of free disk space for 8." and a+o#e 2," M( of free disk space for application files and folders! and an additional '2" M( of free disk space on the s.stem disk /the disk on which the operatin0 s.stem is installed1. After QuickTest Professional is installed! it is recommended to ha#e at least '," M( free disk space on the s.stem disk for the operatin0 s.stem and QuickTest Professional to run correctl.. Browser: Microsoft 2nternet 3plorer ,., Ser#ice Pack 2--.". 4etscape -.'! 4etscape -.22! 4etscape -.2$! 4etscape 5."2! and 4etscape 5.' . A67 8." and 9." .

QTP Testing Process: It #onsists of -even 'ain p(ases.


3. ". 4. 5. . 6. 7. Preparing to record &ecording a session on your application %n(ancing your test Debugging your test &unning your test .naly6ing t(e test results &eporting t(e Defects.

New Features in 8.2 nicode Support for !ultilingual "pplication Testing8 %nables you to test applications t(at use values containing c(aracters fro' al'ost any language, for e9a'ple, +apanese, .rabic, and 0indi. "dvanced #e$word%&riven Testing80elps you design your tests and co'ponents :uic;ly and easily, in a self<docu'enting tabular user interface t(at re:uires no progra''ing ;no$ledge. "uto%&ocumentation'Displays a su''ary of $(at eac( step does, in an easy<to<understand sentence. T(e &ocumentation (nl$ option enables you to auto'atically (ide t(e ot(er colu'ns in t(e =ey$ord Vie$ and display only t(e auto<docu'entation >for tests? or t(e auto<docu'entation and any co''ents >for co'ponents?. )usiness Process Testing'@ses t(e intuitive, ;ey$ord<driven )usiness #o'ponent =ey$ord Vie$ to enable -ubAect Matter %9perts and Quic;Test %ngineers to $or; toget(er to build business process tests and business co'ponents t(at evaluate real business processes. Passing &ata in Tests sing Parameters8-trea'lines t(e passing of values into and fro' your tests and actions. Passing &ata in *omponents sing Parameters8%nables t(e passing of values into and fro' your business co'ponents. !ultiple "pplication "reas for *omponents8%nables you to create and use a different application area for eac( part of your application. %ac( application area specifies t(e resources and settings t(at can be used by a co'ponent. Step +enerator for Test Steps8&eplaces t(e Met(od Bi6ard $it( a dialog bo9 t(at (elps you :uic;ly and easily add 'et(ods, reserved obAects, and function state'ents to your test. Function &efinition +enerator8%nables you to :uic;ly docu'ent and register ne$ user<defined functions for tests and co'ponents. ,ig-lig-t .epositor$ (/0ect in "pplication8Quic;ly locates a selected repository obAect in your application. For use $it( tests and co'ponents. Sample .esource Files for se 1it- *omponents8Provides you $it( a set of predefined resource files t(at you can associate $it( an application area or a specific co'ponent. (pen 2!3 .eport Format for Test .esults8Provides results for tests or co'ponents in an open, 2M1 for'at.

"ctive screen:% T(e .ctive screen provides a snaps(ot of your application, as it

appeared $(en you perfor'ed a certain step $(ile recording your test. T(is enables you to easily para'eteri6e obAect values and insert c(ec;points, 'et(ods and output values for any obAect in t(e page, even if your application is not available or you do not (ave step in your test corresponding to t(e selected obAect .

"ctive screen capture level:%


*omplete:% #aptures all properties of all obAects in t(e active screen of eac( step. -aves all $eb pages after any dyna'ic c(anges. Partial:% #aptures only properties related to t(e recorded obAect for ot(er steps in t(e sa'e parent obAect. -aves all $eb pages after any dyna'ic c(anges and saves active screen files in a co'pressed for'at !inimum:% #aptures a 'ini'al set of properties in eac( step. None:%&isable capturing of active screen files for all applications and $eb pages. *-ange "ctive Screen:% .s t(e content of your application or $ebsite c(anges, you can continue to use tests you developed previously . Cou si'ply update t(e selected. .ctive screen display so t(at you can use t(e .ctive -creen to add ne$ steps to your test rat(er t(an re<recording steps on ne$ or 'odified obAects. Note:% B(en recording on Bin 'enu obAects t(e active screen is not captured. you cannot insert an 2M1 c(ec; point fro' t(e active screen. Cou cannot insert a c(ec;point on a $in 'enu obAect.

&ata Ta/le:
+lo/al S-eet: T(is enables you to s(are infor'ation fro' one action to anot(er action. "ction S-eet: %ac( action (as its o$n s(eet in t(e data table. -o t(at you can insert data t(at applies to only t(at action. Note: Cou cannot select current action s(eet >1ocal? $(en para'eteri6ing t(e value of an obAect repository if your test uses a s(ared obAect repository file. &e/ug viewer pane:% T(e debug vie$er pane contains t(ree tabs to assist you in debugging your test. Batc( %9pressions, Variables and #o''and tabs. sing t-e de/ug viewer:% $(en a test stops at a brea; point , you use t(e debug vie$er pane to vie$ , set or 'odify t(e current value of obAects or variables in your test. 1atc- E4pressions ta/: < T(e $atc( %9pressions tab enables you to vie$ t(e current value of any variable or ot(er V)-cript e9pressions. 5aria/les ta/:% T(e variables tab enables you to vie$ t(e current value of all variables t(at (ave been recogni6ed up to t(e last step perfor'ed in t(e test run. *ommand Ta/:% T(e co''and tab enables you to e9ecute a line of script in order to set or 'odify t(e current value of a variable or V) script obAect in your test. B(en you continue running t(e test, :uic; test uses t(e ne$ value t(at $as set in t(e co''and.

*-oosing .ecording !ode: Normal recording !ode: )y default Quic; test records in t(e ,or'al recording 'ode. Quic; testDs nor'al recording 'ode records t(e obAects in your application and t(e operations perfor'ed on t(e'.

"nalog recording mode:


@se analog recording for applications in $(ic( t(e actual 'ove'ent of t(e 'ouse is $(at you $ant to record. T(ese can include dra$ing a 'ouse signature or $or;ing $it( dra$ing applications t(at create i'ages by dra$ing 'ouse. a6 .ecord relative to a specified window:% If t(e operations you perfor' on obAects located $it( in one $indo$ and t(at $indo$ does not 'ove during t(e analog recording session. Quic; test does not record any clic; or 'ouse 'ove'ent perfor'ed outside t(e specified $indo$. /6 .ecord .elative to t-e screen:% If t(e $indo$ on $(ic( you are recording your analog steps 'oves during recording or if t(e operations you perfor' are on obAects located $it( in 'ore t(an one $indo$. T(is can include dragging and dropping of an obAect fro' $indo$ to anot(er. Note: % a? T(e steps recorded using analog recoding are saved in a separate data file. T(is file is stored $it( t(e action in $(ic( t(e analog steps are recorded. b? B(en you record in analog recording 'ode, :uic; test adds to your test a E&un analogF state'ent t(at calls t(e recorded analog file. 3ow%3evel .ecording !ode: % 3? @se 1o$<1evel recording for recording on environ'ents or obAects not supported by :uic; test. "? @se 1o$<1evel recording for $(en you need to record t(e e9act location of t(e obAect on your application screen. If t(e location of t(e obAect is i'portant to your test s$itc( to 1o$<1evel recording to enable :uic; test to record t(e obAect in ter's of its 9 and y coordinates on t(e screen. T(is $ay t(e step $ill pass only if t(e obAect is in t(e correct position. %ac( step recorded in 1o$<1evel recording 'ode is s(o$n in t(e test tree and test script. ,oteG < a?. .nalog recording records only t(e one<-tep in t(e test tree t(at calls t(e e9ternal analog data file. b?. 1o$<1evel recording, .nalog recording option is not available $(ile editing a test. ,oteG < To step an analog step in t(e 'iddle of a test run, clic; #T&*%-#, t(en clic; stop in t(e test toolbar. c?. T(is 'ode records at t(e obAect level and records all run ti'e obAects as $indo$ or $in obAect test obAects. Note: Quic;Test does not support virtual obAects for analog or lo$<level recording. .eport:% Insert<Hstep<Hreport Cou can define a 'essage in your test t(at :uic; test sends to your test results. -elect t(e status t(at $ill result fro' t(is step fro' t(e status list. Passed:% #auses t(is step to pass. -ends t(e specified 'essage to t(e report. Failed:% #auses t(is step to fail. -ends t(e specified 'essage to t(e report &one:% -ends a 'essage to t(e report $it( out affecting t(e passIfail status of t(e step.

1arning:% sends a $arning status for t(e step but does not cause t(e test to stop running and does not affect t(e passIfail status of t(e test. Note: % . s(are obAect repository file created in QTP6. cannot be opened and saved in QTP 6.0. -aving t(e s(ared obAect repository file in QTP 6.0 $ill destroy t(e file.

(/0ect identification:
Quic; test (as a predefined set of properties t(at it learns for eac( test obAect. If t(ese 'andatory property values are not sufficient to uni:uely identify an obAect you record, :uic; test can add so'e assistive properties andIor an ordinal identifier in order to create a uni:ue description. !andator$ Properties: Mandatory properties are properties t(at :uic; test al$ays learns for a particular test obAect class. "ssistive Properties: .ssistive properties are properties t(at :uic; test learns only if t(e 'andatory properties t(at :uic; test learns for a particular obAect in your application are not sufficient to create a uni:ue description. If several assistive properties are defined for an obAect class, t(en :uic; test learns one assistive property at a ti'e and steps as soon as it creates a uni:ue description for t(e obAect. If :uic; test does learn assistive properties, t(ose properties are added to t(e test obAect description. Note: If t(e co'bination all defined 'andatory and assistive properties is not sufficient to create a uni:ue test obAect description, :uic; test also records t(e value for t(e selected ordinal identifier. B(en you run a test or co'ponent, :uic; test searc(es for t(e obAect t(at 'atc(es t(e description it learned >$it( out t(e ordinal identifier?. If it cannot find any obAect t(at 'atc(es t(e description or if it finds 'ore t(an one obAect t(at 'atc(es, :uic; test uses t(e s'art identification 'ec(anis' >if enabled? to identify t(e obAect. In 'any cases, a s'art identification description can (elp :uic; test to identify an obAect, if it is present, even $(en t(e recorded description fails due to c(anges in one or 'ore property values. T(e test obAect description is used toget(er $it( t(e ordinal identifier only in cases $(ere t(e s'art identification 'ec(anis' does not succeed in narro$ing do$n t(e obAect candidates to a single obAect. (rdinal 7dentifier: T(e ordinal identifier assigns t(e obAect nu'erical values t(at indicate its order relative to ot(er obAects $it( an ot(er$ise identical description. >/bAects t(at (ave t(e sa'e values for all properties specified in t(e 'andatory and assistive property lists?. T(ese are 4 types of ordinal identifiers t(at :uic; test can use to identify an obAect. 7nde4: Indicates t(e order in $it( t(e obAect appears in t(e application code relative to ot(er obAects $it( an ot(er$ise identical description.

3ocation: Indicates t(e order in $(ic( t(e obAect appears $it( in t(e parent $indo$, fra'e, or dialog bo9 relative to ot(er obAects $it( an ot(er$ise identical description. *reation time: >)ro$ser obAect only? indicates t(e order in $(ic( t(e bro$ser $as opened relative to ot(er open bro$sers $it( an ot(er$ise identical description. Smart identification: % -electing t(e %nable -'art identification c(ec; bo9 for a particular test obAect class instructs :uic; test to record t(e property values of all properties specified as t(e obAectDs base filter or optional filter properties in t(e s'art identification properties dialog bo9. Cou s(ould enable t(e s'art identification 'ec(anis' only for test obAect classes $it( s'art identification configuration defined. *onfiguring smart identification: % #onfiguring s'art identification properties (elps :uic; test to identify obAects in your application even if so'e of t(e properties in t(e obAects recorded description (ave c(anged. If :uic; test is unable to find any obAect t(at 'atc(es t(e recorded obAect description or if it finds 'ore t(an one obAect t(at fits t(e description, t(en :uic; test ignores t(e recorded description, and uses t(e s'art identification 'ec(anis' to try to identify t(e obAect. It uses t$o types of properties. )ase filter properties: %T(e 'ost funda'ental properties of a particular test obAect class, t(ose $(ose values cannot be c(anged $it( out c(anging t(e essence of t(e original obAect. (ptional filter properties: % /t(er properties t(at can (elp identify obAects of a particular class as t(ey are unli;ely to c(ange on a regular basics but $(ic( can be ignored if t(ey are no longer applicable. &isa/le smart identification during t-e test run: % Instructs :uic; test not to use s'art identification 'ec(anis' during t(e test run. Note:% %ven if you c(oose to record s'art identification properties for an obAect, you can disable use of t(e s'art identification 'ec(anis' for a specific obAect in t(e obAect properties or obAect repository dialog bo9 or you can disable t(e s'art identification for an entire test run in Test <H-ettings <H &un tab. "nal$8ing Smart identification information in t-e test results: % If :uic; test successfully uses s'art identification to find an obAect after no obAect 'atc(es t(e recorded description t(e test results receive a $arning status and include t(e follo$ing infor'ation. 7n t-e result tree: < . s'art identification for 'issing obAect For e9a'pleG E@ser na'eF< s'art identification

7n t-e results details: % Infor'ation about t(e properties used to find t(e obAect, you can use t(is infor'ation to 'odify t(e recorded test obAect description, so t(at :uic; test can find t(e obAect using description future test runs. (/0ect repositor$ !ode: T(ere are t$o types of /bAect repository Modes. Per action: Quic; test creates a ne$ obAect repository for eac( action. .s you record operations on obAects in your application, :uic; test auto'atically stores t(e infor'ation about t(ose obAects in t(e appropriate action obAect repository. Cou also can use t(e e9port option to save your obAect repository as a s(ared obAect repository file to use $it( ot(er tests. S-ared o/0ect repositor$: T(is enables you to 3? %asily 'aintain your tests or co'ponents $(en an obAect in your application c(anges. "? Manage all t(e obAects for a suite of tests or co'ponents in one central location. *-oosing (/0ect repositor$ !ode: T(e obAect repository per<action 'ode is easiest to use $(en you are creating si'ple record and run tests, especially under t(e follo$ing conditions. 3? Cou (ave only one or very fe$ tests t(at correspond to a given application interface or set of obAects "? Cou do not e9pect to fre:uently 'odify test obAect properties 4? Jenerally create single action test. T(e s(ared obAect repository 'ode is generally t(e preferred 'ode $(en 3? Cou (ave several tests t(at test ele'ents of t(e sa'e application interface or set of obAects. "? Cou e9pect t(e obAect properties in your application to c(ange fro' ti'e to ti'e andIor you regularly need to update or 'odify test obAect properties. 4? Cou often $or; $it( 'ulti action test and regularly use t(e largest copy of action and insert all to action options. .ecover$ Scenarios: Cou can instruct :uic; test to recover fro' une9pected events and errors t(at occur in your testing environ'ent during a run session. In t(is 5 types are t(ere. Pop%up window9 o/0ect state9 Test run error9 application cras-. Pop%up window: :uic; test detects a pop<up $indo$ and identifies it according to t(e $indo$ title and te9tual content. (/0ect State: Quic; test detects a specific test obAect state and identifies it according to its property values and t(e property values of all its ancestors. ,ote t(at an obAect is identified only by its property values and not by its class. Test run error: Quic; test detects a run error and identifies it by a failed return value fro' 'et(od.

"pplication cras-: Quic; test detects an application cras( and identifies it according to a predefined list of applications. .un !odes: Normal :displa$s e4ecution marker6: % &uns your test $it( t(e e9ecution arro$ to t(e left of t(e test tree, 'ar;ing eac( step or state'ent as it is perfor'ed. If t(e test contains 'ultiple actions, t(e tree vie$ e9pands to display t(e steps and t(e e9pert vie$ displays t(e script of t(e currently running action. T(is option re:uires 'ore syste' resources. Fast: &uns your test $it( out t(e e9ecution arro$ to t(e left of t(e test tree and does not s(o$ t(e tree vie$ or e9pert vie$ of eac( action as it runs. T(is option re:uires fe$er syste' resources. pdate .un: % T(is enables you to run t(roug( your test to update t(e test obAect descriptions, t(e e9pected c(ec;point values andIor t(e active screen i'ages and values. .fter you save t(e test, t(e results of t(e updated test are used for sub se:uent test runs. pdate options: % pdate test o/0ect descriptions8Quic;Test updates t(e test obAect description according to t(e properties currently defined in t(e /bAect Identification dialog bo9 for eac( obAect class. Cou can use t(is option to 'odify t(e set of properties used to identify an obAect. pdate c-eckpoint properties8Quic;Test updates t(e e9pected c(ec;point values to reflect any c(anges t(at 'ay (ave occurred in your application since you recorded t(e test or co'ponent. For e9a'ple, suppose you (ad defined a te9t c(ec;point as part of your test, and t(e te9t in your application (as c(anged since you recorded your test. Cou can update t(e test to update t(e c(ec;point properties to reflect t(e ne$ te9t. E.g: % you (ad defined a te9t c(ec;point as part of your test and t(e te9t in your application (as c(anged since you recorded your test. Cou can update a test to update t(e c(ec;point properties to reflect t(e ne$ te9t. pdate "ctive Screen images and values8Quic;Test updates i'ages and property values in t(e .ctive -creen to reflect any c(anges t(at 'ay (ave occurred in your application since you recorded t(e test or co'ponent or if t(e .ctive -creen does not appear as it s(ould. E.g: %suppose a dialog bo9 in your application (as c(anged since you recorded your test or co'ponent. Cou can update t(e test or co'ponent to update t(e dialog bo9 appearance and its properties in t(e .ctive -creen.

"/out &e/ugging Tests and *omponents .fter you create a test or co'ponent, you s(ould c(ec; t(at it runs s'oot(ly, $it(out errors in synta9 or logic. In order to detect and isolate defects in a test or co'ponent, you can use step co''ands and t(e Pause co''and to control t(e run session. Cou can also do t(is by setting brea;points. B(en t(e test or co'ponent stops at a brea;point, you can use t(e Debug Vie$er to c(ec; and 'odify t(e values of V)-cript obAects and variables. .lso, if Quic;Test displays a run<error 'essage during a run session, you can clic; t(e &e/ug button on t(e error 'essage to suspend t(e test or co'ponent and debug it. Note: Cou can also use t(e .un from Step feature to debug your test or co'ponent. T(is runs your test or co'ponent fro' a selected step to t(e end. sing t-e Step *ommands Cou can run a single step of a test or co'ponent using t(e Step 7nto, Step (ut, and Step (ver co''ands. Tip: To display t(e Debug toolbar, c(oose 5iew ; Tool/ars ; &e/ug. Step 7nto #(oose &e/ug ; Step 7nto, clic; t(e Step 7nto button, or press F33 to run only t(e current line of t(e active test or co'ponent. If t(e current line of t(e active test or co'ponent calls anot(er action or a function, t(e called actionIfunction is displayed in t(e Quic;Test $indo$, and t(e test or co'ponent pauses at t(e first line of t(e called actionIfunction. Step (ut #(oose &e/ug ; Step (ut or clic; t(e Step (ut button, or press -0IFT*F33 only after using Step 7nto to enter a action or a user<defined function. Step (ut runs to t(e end of t(e called action or user<defined function, t(en returns to t(e calling action and pauses t(e run session. Step (ver #(oose &e/ug ; Step (ver or clic; t(e Step (ver button, or press F30 to run only t(e current step in t(e active test or co'ponent. B(en t(e current step calls anot(er action or a user<defined function, t(e called action or function is e9ecuted in its entirety, but t(e called action script is not displayed in t(e Quic;Test $indo$. sing t-e Step *ommands % "n E4ample Follo$ t(e instructions belo$ to create a si'ple test and run it using t(e Step 7nto, Step (ut, and Step (ver co''ands. To create t-e sample test: < #(oose File ; New to open a ne$ test. 2 #lic; t(e E4pert 5iew tab to display t(e %9pert Vie$. = %nter t(e follo$ing lines e9actlyG

public Function 'yfunc>? 'sgbo9 KoneK 'sgbo9 Kt$oK 'sgbo9 Kt(reeK %nd Function 'yfunc 'yfunc 'yfunc To run t-e test using t-e Step 7nto9 Step (ut9 and Step (ver commands: < Press FL >7nsert>.emove )reakpoint? to add a brea;point on t(e sevent( line of t(e test >t(e first call to t(e m$func function?. T(e %9pert Vie$ brea;point sy'bol is displayed in t(e left 'argin. 2 &un t(e test. T(e test pauses at t(e brea;point. = Press F33 >Step 7nto?. T(e e9ecution arro$ points to t(e first line $it(in t(e function >'sgbo9 KoneK?. ? Press F33 >Step 7nto? again. . 'essage bo9 displays t(e te9t one. @ #lic; /= to close t(e 'essage bo9. T(e e9ecution arro$ 'oves to t(e ne9t line in t(e function. A #ontinue pressing F33 >Step 7nto? until t(e e9ecution arro$ leaves t(e function and is pointing to t(e eig(t( line in t(e script >t(e second call to t(e m$func function?. B Press F33 >Step 7nto? to enter t(e function again. T(e e9ecution arro$ points to t(e first msg/o4 line $it(in t(e function. 8 Press -0IFT*F33 >Step (ut?. T(ree 'essage bo9es open. T(e e9ecution arro$ continues to point to t(e first line in t(e function until you close t(e last of t(e t(ree 'essage bo9es. .fter you close t(e t(ird 'essage bo9, t(e e9ecution arro$ points to t(e last line in t(e test. C Press F30 >Step (ver.? T(e t(ree 'essage bo9es open again. T(e e9ecution arro$ re'ains on t(e last line in t(e test. Pausing a .un Session Cou can te'porarily suspend a run session by c(oosing &e/ug ; Pause or clic;ing t(e Pause button. . paused test or co'ponent stops running $(en all previously interpreted steps (ave been run. To resu'e running a paused test or co'ponent, clic; t(e .un button or c(oose Test ; .un or *omponent ; .un. T(e run continues fro' t(e point it $as suspended.

Step +enerator: Specif$ing a Function for t-e Step If you select Functions in t(e *ategor$ bo9 list, you can c(oose one of t(e follo$ing options fro' t(e 3i/rar$ bo9 listG "ll8%nables you to select a function fro' all t(e available functions and types. 3i/rar$ functions8%nables you to select a function fro' any library file associated $it( your test or co'ponent. For 'ore infor'ation about defining and using associated function libraries, see EBor;ing $it( .ssociated 1ibrary FilesF on page !!". )uilt%in functions'%nables you to select any standard V)-cript function supported by Quic;Test. For 'ore infor'ation about $or;ing $it( V)-cript, you can open t(e V)-cript docu'entation fro' t(e Quic;Test 0elp 'enu >,elp ; QuickTest Professional ,elp ; 5)Script .eference?. 3ocal script functions'%nables you to select any local function defined directly in t(e current action or co'ponent. Cou can select t(e re:uired function fro' t(e (peration bo9 list, $(ic( displays t(e functions available for t(e selected function type in alp(abetical order. sing *onditional Statements Cou can control t(e flo$ of your test or co'ponent $it( conditional state'ents. @sing conditional If...Then...Else state'ents, you can incorporate decision<'a;ing into your tests and co'ponents. T(e If...Then...Else state'ent is used to evaluate $(et(er a condition is true or false and, depending on t(e result, to specify one or 'ore state'ents to run. @sually t(e condition is an e9pression t(at uses a co'parison operator to co'pare one value or variable $it( anot(er. T(e follo$ing co'parison operators are availableG less t(an D, less t(an or e:ual to DE, greater t(an ;, greater t(an or e:ual to ;E, not e:ual D;, and e:ual E. Cour If...Then...Else state'ent can be nested to as 'any levels as you need. It (as t(e follo$ing synta9G 7f condition T-en statements MElse elsestatementsN End 7f /r, you can use t(e bloc; for' synta9G 7f condition T-en MstatementsN MElse7f condition-n T-en MelseifstatementsN . . . MElse MelsestatementsN End 7f

sing 3oop Statements Cou can control t(e flo$ of your test or co'ponent $it( loop state'ents. @sing loop state'ents, you can run a group of steps repeatedly, eit(er $(ile or until a condition is True. Cou can also use loop state'ents to repeat a group of steps a specific nu'ber of ti'es. T(e follo$ing loop state'ents are available in t(e =ey$ord Vie$G For...Ne4t Statement . For...Ne4t loop instructs Quic;Test to e9ecute one or 'ore state'ents a specified nu'ber of ti'es. It (as t(e follo$ing synta9G For counter E start to end FStep stepG statement Ne4t 7tem &escription counter T(e variable used as a counter for t(e nu'ber of iterations. start T(e start nu'ber of t(e counter. end T(e last nu'ber of t(e counter. step T(e nu'ber to incre'ent at t(e end of eac( loop. &efault E <. (ptional. statement . state'ent, or series of state'ents, to be e9ecuted during t(e loop. For...Eac- Statement . For...Eac- loop instructs Quic;Test to e9ecute one or 'ore state'ents for eac( ele'ent in an array or an obAect collection. It (as t(e follo$ing synta9G For Eac- item 7n array statement Ne4t 7tem &escription item . variable representing t(e ele'ent in t(e array. array T(e na'e of t(e array. statement . state'ent, or series of state'ents, to be e9ecuted during t(e loop. T(e follo$ing e9a'ple uses a For...Eac- loop to display eac( of t(e values in an array. My.rray O .rray>KoneK,Kt$oK,Kt(reeK,KfourK,KfiveK? For Eac- ele'ent 7n My.rray 'sgbo9 ele'ent Ne4t &o...1-ile8Perfor's a series of state'ents indefinitely, as long as a specified condition is True. &o... ntil8Perfor's a series of state'ents indefinitely, until a specified condition beco'es True.

&o...3oop Statement T(e &o...3oop state'ent instructs Quic;Test to e9ecute a state'ent or series of state'ents $(ile a condition is true or until a condition beco'es true. It (as t(e follo$ing synta9G &o FHw-ileI HuntilI conditionG statement 3oop condition . condition to be fulfilled. statement . state'ent or series of state'ents to be e9ecuted during t(e loop. 1-ile...1end8Perfor's a series of state'ents as long as a specified condition is True. 1-ile Statement . 1-ile state'ent instructs Quic;Test to e9ecute a state'ent or series of state'ents $(ile a condition is true. It (as t(e follo$ing synta9G 1-ile condition statement 1end 7tem &escription condition . condition to be fulfilled. statement . state'ent or series of state'ents to be e9ecuted during t(e loop. "dding *omments B(ile progra''ing, you can add co''ents to your test or co'ponent. . co''ent is an e9planatory re'ar; in a progra'. B(en you run a test or co'ponent, Quic;Test does not process co''ents. Cou can use co''ents to e9plain sections of your tests and co'ponents to i'prove readability and to 'a;e t(e' easier to update. 7nserting *omments . co''ent is a line or part of a line in a script t(at is preceded by an apostrop(e >P?. B(en you run a test, Quic;Test does not process co''ents. @se co''ents to e9plain sections of a script in order to i'prove readability and to 'a;e tests easier to update. !easuring Transactions Cou can 'easure (o$ long it ta;es to run a section of your test by defining transactions. . transaction represents t(e process in your application t(at you are interested in 'easuring. Cou define transactions $it(in your test by enclosing t(e appropriate sections of t(e test $it( start and end transaction state'ents. . transaction can be inserted any$(ere in your test, but 'ust start and end $it(in t(e sa'e action. During t(e test run, t(e -tart Transaction signals t(e beginning of t(e ti'e 'easure'ent. T(e ti'e 'easure'ent continues until t(e %nd Transaction is encountered. T(e test report displays t(e ti'e it too; to perfor' t(e transaction. T(ere is no li'it to t(e nu'ber of transactions t(at can be added to a test. Cou can also insert a transaction $it(in a transaction.

.etrieving and Setting Test (/0ect Propert$ 5alues Test obAect properties are t(e set of properties defined by Quic;Test for eac( obAect. Cou can set and retrieve a test obAectDs property values, and you can retrieve t(e values of test obAect properties fro' a run<ti'e obAect. B(en you run your test, Quic;Test creates a te'porary version of t(e test obAect t(at is stored in t(e test obAect repository. Cou use t(e +etT(Propert$9 +etT(Properties9 and SetT(Propert$ 'et(ods to set and retrieve t(e test obAect property values of t(e test object. T(e +etT(Propert$ and +etT(Properties 'et(ods enable you to retrieve a specific property value or all t(e properties and values t(at Quic;Test uses to identify an obAect. T(e SetT(Propert$ 'et(od enables you to 'odify a property value t(at Quic;Test uses to identify an obAect. Note: )ecause Quic;Test refers to t(e te'porary version of t(e test obAect during t(e test run, any c(anges you 'a;e using t(e SetT(Propert$ 'et(od apply only during t(e course of t(e test run, and do not affect t(e values stored in t(e test obAect repository. For e9a'ple, t(e follo$ing state'ents $ould set t(e Su/mit buttonDs na'e value to 'y button, and t(en retrieve t(e value 'y button to t(e )uttonName variableG )ro$ser>KQ. 0o'e PageK?.Page>KQ. 0o'e PageK?. Beb)utton>K-ub'itK?.-etT/Property K,a'eK, K'y buttonK )utton,a'eO)ro$ser>KQ. 0o'e PageK?.Page>KQ. 0o'e PageK?. Beb)utton>K-ub'itK?.JetT/Property>K,a'eK? Cou use t(e +et.(Propert$ 'et(od to retrieve t(e current value of a test object property fro' a run<ti'e obAect in your application. For e9a'ple, you can retrieve t(e target value of a lin; during t(e test run as follo$sG lin;Q(ref O )ro$ser>KMercury Tec(nologiesK?.Page>KMercury Tec(nologiesK?. 1in;>K+obsK?.GetROProperty>K(refK? .unning &(S *ommands Cou can run standard D/- co''ands in your Quic;Test test using t(e V)-cript Bindo$s -cripting 0ost -(ell obAect >B-#ript.s(ell?. For e9a'ple, you can open a D/- co''and $indo$, c(ange t(e pat( to #GR, and e9ecute t(e &7. co''and using t(e follo$ing state'entsG Di' o-(ell -et o-(ell O #reate/bAect >KB-#ript.s(ellK? o-(ell.run Kc'd I= #D #GR S DirK -et o-(ell O ,ot(ing

Save step screen capture to test results: ,oteG Test<Hsetting<H&un tab Instructs :uic; test $(en to capture and save i'ages of t(e application during t(e test run to display t(e' in t(e test results. "lwa$s: capture i'ages of eac( step $(et(er t(e step fails or passes. (n errors: capture i'ages only if t(e step fails. If $e select t(is no screen captures >including errors? are saved to t(e test results for non<$eb based applications. (n errors and warnings: captures i'ages only if t(e step returns a failed or $arning status. T(is is $(en testing standard $indo$s applications. Never: ,ever capture i'ages. Note: T(e first ti'e :uic; test is started by default, t(e .ctive and $eb add<inns are selected. If t(e beginning of eac( subse:uent :uic; test session your selection fro' t(e previous session is t(e default setting. "ppl$ Jwit- J to script: %dit<H.pply E$it( E to script Cou can i'prove t(e readability of your test using E$it(F state'ents. Cou can instruct :uic; test to auto'atically generate $it( state'ents as you record. )ut even after your basic test is recorded, you can convert its state'ents, in t(e e9pert vie$ to $it( state'ents<by selecting a 'enu co''and. ,ote t(at generating $it( state'ents for your test does not affect t(e tree vie$ in any $ay. S$nc-roni8ation point: %To solves t(e anticipated ti'ing proble's bet$een t(e application and t(e tool $e can go for sync(roni6ation. For e.g.G < It 'ig(t ta;e a fe$ seconds For a progress bar to reac(300T. For a status 'essage to appear. For a button to beco'e enabled For a $indo$ or pop<up 'essage to open .egular e4pressions:% &egular e9pressions enable :uic; test to identify obAects and te9t strings $it( varying values. Cou can use &egular %9pressions $(en Defining t(e property values of an obAect Para'eteri6e a step #reating c(ec;points $it( varying values Note:% you can use regular e9pressions only for values of type string.

*-eck Pont: . c(ec;point is a verification point t(at co'pares a current value for a specified property $it( t(e e9pected value for t(at property. T(is enables you to identify $(et(er your Beb site or application is functioning correctly. Cou can add c(ec;points during a recording session or $(ile editing your test or co'ponent. It is generally 'ore convenient to define c(ec;s once t(e initial test or co'ponent (as been recorded. Standard *-eckpoint c(ec;s t(e property value of an obAect in your application or Beb page. T(e standard c(ec;point c(ec;s a variety of obAects suc( as buttons, radio buttons, co'bo bo9es, lists, and so fort(. For e9a'ple, you can c(ec; t(at a radio button is activated after it is selected or you can c(ec; t(e value of an edit field. 7mage *-eckpoint c(ec;s t(e value of an i'age in your application or Beb page. For e9a'ple, you can c(ec; t(at a selected i'ageDs source file is correct. Note: Cou create an i'age c(ec;point by inserting a standard c(ec;point on an i'age obAect. I'age c(ec;points are supported for t(e Beb environ'ent )itmap *-eckpoint c(ec;s an area of your Beb page or application as a bit'ap. For e9a'ple, suppose you (ave a Beb site t(at can display a 'ap of a city t(e user specifies. T(e 'ap (as control ;eys for 6oo'ing. Cou can record t(e ne$ 'ap t(at is displayed after one clic; on t(e control ;ey t(at 6oo's in t(e 'ap. @sing t(e bit'ap c(ec;point, you can c(ec; t(at t(e 'ap 6oo's in correctly. )it'ap c(ec;points are supported for all add<in environ'ents Ta/le *-eckpoint c(ec;s infor'ation $it(in a table. For e9a'ple, suppose your application or Beb site contains a table listing all available flig(ts fro' ,e$ Cor; to -an Francisco. Cou can add a table c(ec;point to c(ec; t(at t(e ti'e of t(e first flig(t in t(e table is correct. Note: Cou create a table c(ec;point by inserting a standard c(ec;point on a table obAect. Table c(ec;points are supported for Beb and .ctive2 environ'ents Te4t *-eckpoint c(ec;s t(at a te9t string is displayed in t(e appropriate place in your application or on a Beb page. For e9a'ple, suppose your application or Beb page displays t(e sentence Flig(t departing fro' ,e$ Cor; to -an Francisco. Cou can create a te9t c(ec;point t(at c(ec;s t(at t(e $ords E,e$ Cor;F are displayed bet$een EFlig(t departing fro'F and Eto -an FranciscoF. Te9t c(ec;points are supported for all add<in environ'ents

Te4t "rea *-eckpoint c(ec;s t(at a te9t string is displayed $it(in a defined area in a Bindo$s application, according to specified criteria. For e9a'ple, suppose your Visual )asic application (as a button t(at says Vie$ Doc U,u'H, $(ere U,u'H is replaced by t(e four digit code entered in a for' else$(ere in t(e application. Cou can create a te9t area c(ec;point to confir' t(at t(e nu'ber displayed on t(e button is t(e sa'e as t(e nu'ber entered in t(e for'. Te9t area c(ec;points are supported for -tandard Bindo$s, Visual )asic, and .ctive2 add<in environ'ents "ccessi/ilit$ *-eckpoint identifies areas of your Beb site t(at 'ay not confor' to t(e Borld Bide Beb #onsortiu' >B4#? Beb #ontent .ccessibility Juidelines. For e9a'ple, guideline 3.3 of t(e B4# Beb #ontent .ccessibility Juidelines re:uires you to provide a te9t e:uivalent for every non<te9t ele'ent. Cou can add an "lt property c(ec; to c(ec; $(et(er obAects t(at re:uire t(e "lt property under t(is guideline, do in fact (ave t(is tag. .ccessibility c(ec;points are supported for t(e Beb environ'ent Page *-eckpoint c(ec;s t(e c(aracteristics of a Beb page. For e9a'ple, you can c(ec; (o$ long a Beb page ta;es to load or $(et(er a Beb page contains bro;en lin;s. Note: Cou create a page c(ec;point by inserting a standard c(ec;point on a page obAect. Page c(ec;points are supported for t(e Beb environ'ent &ata/ase *-eckpoint c(ec;s t(e contents of a database accessed by your application. For e9a'ple, you can use a database c(ec;point to c(ec; t(e contents of a database containing flig(t infor'ation for your Beb site. Database c(ec;points are supported by all environ'ents 2!3 *-eckpoint c(ec;s t(e data content of 2M1 docu'ents in 2M1 files or 2M1 docu'ents in Beb pages and fra'es. For 'ore infor'ation on 2M1 c(ec;points, see #(apter 33, E#(ec;ing 2M1.F 2M1 c(ec;points >Beb pageIfra'e? are supported for t(e Beb environ'entV 2M1 c(ec;points >file? are supported by all environ'ents

Supported *-eckpoints T(e follo$ing table s(o$s t(e types of c(ec;points supported for eac( environ'ent t(at is supported by default $it( t(e Quic;Test Professional installation.

We b

St d

VB

Active X

Other Object

Standard Image Table Text Text Area Bitmap Accessibility XML age !atabase

S S S S NS S S S S NA

S NS NS S S S NS NS NA NA

S NS NS S S S NS NS N A N A

S NS S S S S NS NS NA NA

NA NA NA NA NA NA NA S (File) NA S (DbTable )

-8-upported ,-8,ot -upported ,.8,ot .pplicable Parameteri8ation: Quic;Test enables you to e9pand t(e scope of a basic test or co'ponent by replacing fi9ed values $it( para'eters. T(is process, ;no$n as para'eteri6ation, greatly increases t(e po$er and fle9ibility of your test or co'ponent. "/out Parameteri8ing 5alues: Cou can use t(e para'eter feature in Quic;Test to en(ance your test or co'ponent by para'eteri6ing t(e values t(at it uses. . parameter is a variable t(at is assigned a value fro' an e9ternal data source or generator. Cou can para'eteri6e values in steps and c(ec;points in your test or co'ponent. Cou can also para'eteri6e t(e values of action para'eters. If you $is( to para'eteri6e t(e sa'e value in several steps in your test or co'ponent, you 'ay $ant to consider using t(e Data Driver rat(er t(an adding para'eters 'anually.

T(ere are four types of para'etersG Test9 action or component parameters enable you to use values passed fro' your test or co'ponent, or values fro' ot(er actions in your test. In order to use a value $it(in a specific action, you 'ust pass t(e value do$n t(roug( t(e action (ierarc(y of your test to t(e re:uired action. Cou can t(en use t(at para'eter value to para'eteri6e a step in your test or co'ponent. For e9a'ple, suppose t(at you $ant to para'eteri6e a step in .ction4 using a value t(at is passed into your test fro' t(e e9ternal application t(at runs >calls? your test. Cou can pass t(e value fro' t(e test level to .ction3 >a top level action? to .ction4 >a c(ild action of .ction3?, and t(en para'eteri6e t(e re:uired step using t(is .ction input para'eter value >t(at $as passed t(roug( fro' t(e e9ternal application?. &ata Ta/le parameters enable you to create a data-driven test >or action? t(at runs several ti'es using t(e data you supply. In eac( repetition, or iteration, Quic;Test uses a different value fro' t(e Data Table. For e9a'ple, suppose your application or Beb site includes a feature t(at enables users to searc( for contact infor'ation fro' a 'e'bers(ip database. B(en t(e user enters a 'e'berDs na'e, t(e 'e'berDs contact infor'ation is displayed, toget(er $it( a button labelled 5iew D!emName;Ks Picture, $(ere D!emName; is t(e na'e of t(e 'e'ber. Cou can para'eteri6e t(e na'e property of t(e button so t(at during eac( iteration of t(e run session, Quic;Test can identify t(e different picture buttons. Environment varia/le parameters enable you to use variable values fro' ot(er sources during t(e run session. T(ese 'ay be values you supply, or values t(at Quic;Test generates for you based on conditions and options you c(oose. For e9a'ple, you can (ave Quic;Test read all t(e values for filling in a Beb for' fro' an e9ternal file, or you can use one of Quic;TestDs built<in environ'ent variables to insert current infor'ation about t(e 'ac(ine running t(e test or co'ponent. .andom num/er parameters enable you to insert rando' nu'bers as values in your test or co'ponent. For e9a'ple, to c(ec; (o$ your application (andles s'all and large tic;et orders, you can (ave Quic;Test generate a rando' nu'ber and insert it in a num/er of tickets edit field. (utput 5alue: .n output value is a step in $(ic( one or 'ore values are captured at a specific point in your test or co'ponent and stored for t(e duration of t(e run session. T(e values can later be used as input at a different point in t(e run session. B(en you create output value steps, you can deter'ine $(ere t(e values are stored during t(e run session and (o$ t(ey can be used. During t(e run session, Quic;Test retrieves eac( value at t(e specified point and stores it in t(e specified location. B(en t(e value is needed later in t(e run session, Quic;Test retrieves it fro' t(is location and uses it as re:uired. /utput values are stored only for t(e duration of t(e run session. B(en t(e run session is repeated, t(e output values are reset. *reating (utput 5alues B(en you add an output value step to your test or co'ponent, you first select t(e category of values to output, for e9a'ple, property values, te9t values, or 2M1 ele'ent values. Cou can t(en deter'ine $(ic( values to output and t(e storage location for eac( value.

Standard (utput 5alues Cou can use standard output values to output t(e property values of 'ost obAects. For e9a'ple, in a Beb<based application, t(e nu'ber of lin;s on a Beb page 'ay vary based on t(e selections a user 'a;es on a for' on t(e previous page. Cou could create an output value in your test to store t(e nu'ber of lin;s on t(e page. Cou can also use standard output values to output t(e contents of table cells. Tip: Cou can use standard output values to output te9t strings by specifying t(e te4t property of t(e obAect as an output value. T(is is t(e preferred $ay of outputting t(e te9t displayed in 'any Bindo$s applications. Te4t and Te4t "rea (utput 5alues Cou can use te9t output values to output te9t strings displayed in a screen or Beb page. B(en creating a te9t output value, you can output a part of t(e obAectDs te9t. Cou can also specify t(e te9t before and after t(e output te9t. Cou can use te9t area output values to output te9t strings displayed $it(in a defined area of a screen in a Bindo$s application. For e9a'ple, suppose t(at you $ant to store t(e te9t of any error 'essage t(at appears after a specific step in t(e application you are testing. Inside t(e 7f state'ent you c(ec; $(et(er a $indo$ e9ists $it( a ;no$n title bar value, for e9a'ple %rror. If it e9ists, you output t(e te9t in t(is $indo$ >assu'ing t(at t(e $indo$ si6e is t(e sa'e for all possible error 'essages?. *onsiderations for sing a Te4t (utput 5alue for 1indows%)ased "pplications T(e te9t<recognition 'ec(anis' used $(en you create a te9t or te9t area output value on a Bindo$s<based application 'ay occasionally retrieve un$anted te9t infor'ation >suc( as (idden te9t and s(ado$ed te9t, $(ic( appears as 'ultiple copies of t(e sa'e string?. .dditionally, te9t >and te9t area? output values 'ay be(ave differently in different run sessions depending on t(e operating syste' version you are using, service pac;s you (ave installed, ot(er installed tool;its, t(e .PIs used in your application, and so fort(. T(erefore, $(en possible, it is (ig(ly reco''ended to retrieve te9t fro' your application $indo$ by using a standard output value step to output t(e value of t(e obAectDs te4t >or si'ilar? property. ,ote t(at t(e above issues do not apply $(en $or;ing $it( Beb<based applications. &ata/ase (utput 5alues Cou can use database output values to output t(e value of t(e contents of database cells, based on t(e results of a :uery >result set? t(at you define on a database. Cou can create output values fro' t(e entire contents of t(e result set, or fro' a part of it. During t(e run session, Quic;Test retrieves t(e current data fro' t(e database and outputs t(e values according to t(e settings t(at you specified.

2!3 (utput 5alues Cou can use 2M1 output values to output t(e values of 2M1 ele'ents and attributes in 2M1 docu'ents. .fter t(e run session (as finis(ed, you can vie$ su''ary results of t(e 2M1 output values in t(e Test &esults $indo$. Cou can also vie$ detailed results by opening t(e 2M1 /utput Value &esults $indo$. For e9a'ple, assu'e t(at an 2M1 docu'ent in a Beb page contains a price list for ne$ cars. Cou can output t(e price of a particular car by selecting t(e appropriate 2M1 ele'ent value to output. (utput 5alue *ategories and Environments T(e follo$ing table s(o$s t(e categories of output values t(at are supported by eac( environ'ent.
Web VB Active X S NA S S S NA NA Other &nvir$nment

O"tp"t Val"e #ateg$ry Standard age 'Standard( Table 'Standard( Text Text area !atabase XML

Standard Wind$%s S NA NA S S NA NA

S S S S NS NS S

S NA NA S S NA NA

NA NA NA NA NA S (DbTable) XML file

-8-upported ,-8,ot -upported ,.8,ot .pplicable 1e/ event .ecording *onfiguration:% Quic; test creates your test by recording t(e events you perfor' on your $eb based application. .n event is a notification t(at occurs in response to an operation. T(e $eb event &ecording configuration offers t(ree standard event configuration levels. )asic:% &ecords clic; events on all standard obAects and 'ouse over events on I'age 'aps. !edium:% &ecords clic; events on several additional 0TM1 tag obAects in addition to t(ose recorded in t(e standard level. ,ig-:% &ecords all clic;, 'ouse over , 'ouse do$n and double clic; events on -tandard obAects $it( (andlers or be(aviors attac(ed.

*reating an "ction Template: If you $ant to include one or 'ore state'ents in every ne$ action in your test, you can create an action te'plate. For e9a'ple, if you al$ays enter your na'e as t(e aut(or of an action, you can add t(is co''ent line to your action te'plate. .n action te'plate applies only to actions created on your co'puter. To create an action template: < #reate a te9t file containing t(e co''ents, function calls, and ot(er state'ents t(at you $ant to include in your action te'plate. T(e te9t file 'ust be in t(e structure and for'at used in t(e %9pert Vie$. 2 -ave t(e te9t file as "ctionTemplate.mst in your DQuickTest installationFolder;Ldat folder. .ll ne$ actions you create contain t(e script lines fro' t(e action te'plate. Note: /nly t(e file na'e "ctionTemplate.mst is recogni6ed as an action "/out 1orking wit- ser%&efined Functions If you (ave large seg'ents of code t(at you need to use several ti'es in one test or co'ponent or in several different tests or co'ponents, you 'ay $ant to create a user< defined function in order to 'a;e your tests or co'ponents easier to design and to read. Cou can define t(ese functions $it(in an individual test or co'ponent, or you can create one or 'ore e9ternal V)-cript library files containing your functions, so t(at you can access t(e' fro' any test or co'ponent. Note: If you define a function directly in an action, t(e function can be called only in t(at action. If you $ant t(e function to be available for t(e entire test, save it in a .v/s file and specify it as an associated library file in t(e Test ; Settings ; .esources tab. For 'ore infor'ation about specifying associated library files, 1orking wit- "ssociated 3i/rar$ Files Cou can create V)-cript library files containing V)-cript functions, subroutines, classes, 'odules, and so fort(, and t(en associate t(e files $it( your test or co'ponent. Cou can call any V)-cript function, subroutine, and so fort(, contained $it(in any library file t(at is associated $it( your test or co'ponent. .ny te9t file $ritten in standard V)-cript synta9 can act as a library file. ,ote t(at t(e functions $it(in library files can call Quic;Test reserved objects, t(e obAects t(at Quic;Test supplies for en(ance'ent purposes, suc( as utility obAects. Note: In addition to t(e functions available in t(e associated library files, you can also call a function contained in a V)-cript file directly fro' any action or co'ponent using t(e E4ecuteFile function. Cou can also insert E4ecuteFile state'ents $it(in an associated library file. Cou can specify t(e default library files for all ne$ tests in t(e Test -ettings dialog bo9 >Test ; Settings ; .esources tab?. Note: .fter a test is created, t(e list of files specified in t(e Test -ettings dialog bo9 is independent of t(e files set as default in t(e Test -ettings dialog bo9. #(anges to t(e default library files list in t(e Test -ettings dialog bo9 do not affect e9isting tests.

E4ecuting E4ternall$%&efined Functions from Mour Test or *omponent Cou can create a V)-cript file and call its functions, subroutines, classes, and so fort(, fro' an action in your test, fro' a co'ponent, or fro' an associated library file, by inserting an E4ecuteFile state'ent in your action, co'ponent, or library file. B(en you run your test or co'ponent, t(e E4ecuteFile state'ent e9ecutes all global code in t(e specified file in order to 'a;e all definitions in t(e file available fro' t(e global scope of t(e actionDs, co'ponentDs, or library fileDs script. To e4ecute an e4ternall$%defined function: #reate a V)-cript file using standard V)-cript synta9. -tore t(e file in any folder t(at you can access fro' t(e 'ac(ine running your test or co'ponent. .dd an E4ecuteFile state'ent to a co'ponent, to an action in your test, or in an associated library file using t(e follo$ing synta9G E4ecuteFile ile!ame $(ere ile!ame is t(e absolute or relative pat( of your V)-cript file. @se t(e functions, subroutines, classes, and so fort(, fro' t(e specified V)-cript file as necessary in your action or co'ponent, or $it(in ot(er functions in an associated library file. Notes: T(e E4ecuteFile state'ent utili6es t(e V)-cript E4ecute+lo/al state'ent. B(en you run an E4ecuteFile state'ent $it(in an action, you can call t(e functions in t(e file only fro' t(e current action. To 'a;e t(e functions in a V)-cript file available to your entire test, add t(e file na'e to t(e associated library files list in t(e &esources tab of t(e Test -ettings dialog bo9 .egistering ser%&efined Functions as Test (/0ect !et-ods Cou can use t(e .egister serFunc 'et(od to add ne$ 'et(ods to test obAects or to c(ange t(e be(avior of an e9isting test obAect 'et(od during a run session. Cou use t(e nregister serFunc state'ents to disable ne$ 'et(ods or to return e9isting 'et(ods to t(eir original Quic;Test be(avior. To register a user%defined function as a test o/0ect met-od9 use t-e following s$nta4: .egister serFunc TO"lass, #ethod!ame, unction!ame To unregister a user%defined met-od9 use t-e following s$nta4: n.egister serFunc TO"lass, #ethod!ame

(/0ect Sp$ Cou can vie$ or 'odify t(e test obAect property values t(at are stored $it( your test or co'ponent in t(e /bAect Properties or /bAect &epository dialog bo9. Cou can vie$ t(e current test obAect property values of any obAect on your des;top using t(e Properties tab of t(e /bAect -py. Cou can vie$ t(e synta9 of t(e test obAect 'et(ods as $ell as t(e run<ti'e 'et(ods of any obAect on your des;top using t(e Met(ods tab of t(e /bAect -py. #(oose Tools ; (/0ect Sp$ or clic; t(e (/0ect Sp$ toolbar button to open t(e /bAect -py dialog bo9 and display t(e Properties tab. .lternatively, clic; t(e (/0ect Sp$ button fro' t(e /bAect &epository dialog bo9. If t(e obAect on $(ic( you $ant to spy can only be displayed by perfor'ing an event >suc( as a rig(t<clic; or a 'ouse<over to display a conte9t 'enu?, (old t(e #T&1 ;ey. T(e pointing (and te'porarily turns into a standard arro$ and you can perfor' t(e event. B(en t(e obAect on $(ic( you $ant to spy is displayed, release t(e #T&1 ;ey. T(e arro$ beco'es a pointing (and again. Note: Pressing t(e #T&1 ;ey does not enable you to select an application fro' t(e Bindo$s tas;bar, t(erefore you 'ust 'a;e sure t(at t(e $indo$ you $ant to access is not 'ini'i6ed. Notes: Cou can use virtual obAects only $(en recording and running a test or co'ponent. Cou cannot insert any type of c(ec;point on a virtual obAect, or use t(e /bAect -py to vie$ its properties.

Das könnte Ihnen auch gefallen