Unified Functional Testing SoftwareVersion:14.03 GUI Testing Tutorial for Web Applications GotoHELP CENTERONLINE http://admhelp.microfocus.com/uft/ DocumentReleaseDate:February22,2018|SoftwareReleaseDate:February2018 GUITestingTutorialforWebApplications UnifiedFunctionalTesting Legal Notices Disclaimer Certainversionsofsoftwareand/ordocuments(“Material”)accessibleheremaycontainbrandingfromHewlett-PackardCompany (nowHPInc.)andHewlettPackardEnterpriseCompany. AsofSeptember1,2017,theMaterialisnowofferedbyMicroFocus,a separatelyownedandoperatedcompany. AnyreferencetotheHPandHewlettPackardEnterprise/HPEmarksishistoricalinnature, andtheHPandHewlettPackardEnterprise/HPEmarksarethepropertyoftheirrespectiveowners. Warranty TheonlywarrantiesforSeattleSpinCo,Inc.anditssubsidiaries(“Seattle”)productsandservicesaresetforthintheexpress warrantystatementsaccompanyingsuchproductsandservices.Nothinghereinshouldbeconstruedasconstitutinganadditional warranty.Seattleshallnotbeliablefortechnicaloreditorialerrorsoromissionscontainedherein.Theinformationcontainedherein issubjecttochangewithoutnotice. RestrictedRightsLegend Confidentialcomputersoftware.Exceptasspecificallyindicated,validlicensefromSeattlerequiredforpossession,useorcopying. ConsistentwithFAR12.211and12.212,CommercialComputerSoftware,ComputerSoftwareDocumentation,andTechnicalDatafor CommercialItemsarelicensedtotheU.S.Governmentundervendor'sstandardcommerciallicense. CopyrightNotice ©Copyright1992-2018EntITSoftwareLLC TrademarkNotices Adobe™isatrademarkofAdobeSystemsIncorporated. Microsoft®andWindows®areU.S.registeredtrademarksofMicrosoftCorporation. UNIX®isaregisteredtrademarkofTheOpenGroup. OracleandJavaareregisteredtrademarksofOracleand/oritsaffiliates. UnifiedFunctionalTesting(14.03) Page2of112 GUITestingTutorialforWebApplications UnifiedFunctionalTesting Contents UnifiedFunctionalTesting 1 WelcometotheUFTTutorialforGUITesting 5 IntroducingUnifiedFunctionalTesting-GUITestingforWebApplications 7 BenefitsofAutomatedGUITesting 8 TestingProcess 9 UFTWindow 10 AnalyzingYourApplicationandCreatingActions 15 GettingtoKnowYourApplication 16 ExploretheMercuryToursWebSite 16 CreatingTests 18 CreateaNewSolution,Test,andActions 19 CreatingObjectRepositories 24 IntroducingTestObjectsandObjectRepositories 25 LearnObjectsinYourApplication 26 UseMultipleObjectRepositories 33 CreatingFunctionsandFunctionLibraries 37 IntroducingFunctions 38 CreateaFunction 38 AssociatetheFunctionLibrarywithYourTest 40 AddingSteps 41 PreparingtoAddStepstoaTest 42 AddStepstotheLoginAction 42 AnalyzingtheLoginActionintheKeywordView 47 AddtheRemainingStepstoYourTest 48 AddStepstotheFlightFinderActionbyRecording 49 AddaSteptotheSelectFlightActionUsingtheToolboxPane 54 AddStepstotheBookFlightActionUsingtheEditorandStepGenerator 55 RunningandAnalyzingTests 63 RunaTest 64 NavigatingtheRunResults 66 AnalyzetheRunResults 66 UnifiedFunctionalTesting(14.03) Page3of112 GUITestingTutorialforWebApplications UnifiedFunctionalTesting CreatingCheckpointsandUsingFunctions 68 UnderstandingCheckpointTypes 69 CreateaCheckpointTest 70 CheckObjectValues 71 CheckPages 74 CheckTableValues 77 CheckTextValues 82 ManageCheckpointsintheObjectRepository 87 RunandAnalyzeaTestwithCheckpoints 88 PerformaCheckUsingaFunction 92 ParameterizingStepsandObjects 98 ParameterizinganAction 99 CreateaTestforParameterization 99 DefineaDataTableParameter 100 AddParameterValuestoaDataTable 102 ModifyStepsAffectedbyParameterization 103 RunningandAnalyzingaParameterizedTest 105 WhereDoYouGoFromHere? 108 ModifyingUFTSettingstoSaveDiskSpace 109 TestingYourOwnApplication-GettingStarted 109 SendUsFeedback 111 UnifiedFunctionalTesting(14.03) Page4of112 Welcome to the UFT Tutorial for GUI Testing TheUFTTutorialforGUITestingforWebapplicationsisaself-pacedguidethatteachesyouthebasics oftestingyourWebapplicationwithUFT.Itwillfamiliarizeyouwiththeprocessofcreatingandrunning automatedGUItestsandanalyzingtherunresults. Aftercompletingthetutorial,youcanapplytheskillsyouhavelearnedtotestingyourownapplication orWebsite. Note:TolearnmoreaboutcreatingandrunningAPItests,seethemainTutorialintheUFT OnlineHelp.. Tutorialaudience and scope ThistutorialisintendedforuserswhoarenewtoUFT.NopriorknowledgeofUFTisrequired,although ageneralunderstandingoftestingconceptsandfunctionaltestingprocessesmaybehelpful. UFTenablesyoutocreateGUItests,businessprocesstests,andAPItests.Thistutorialreviewstopics relatedtoGUItestingonly,andyoumaynoticeUIelementsthatarenotdescribedhere.Thesemaybe relevantforBPTorAPItestingonly,andarenotrelevantforGUItestingatall. File system paths ThistutorialreferstofilesystempathsthatarerelevantforWindows7operatingsystems.Thepathsin otheroperatingsystemsmaybeslightlydifferent. Tutorialdemosite ThistutorialusesthelegacyMercuryToursdemosite. Bydefault,UFTnowsetsyourRecordandRunsettingstothenewerAdvantageOnlineShopping demosite.Whenusingthistutorial,besuretoupdatetheRecordandRunSettingstoopen http://newtours.demoaut.com/whenyourecordorrunyourtest. Using UFTwith BPT Inadditiontotests,UFTenablesyoutocreateserviceandkeyword-drivenbusinesscomponentsfor useinbusinessprocesstests,ifyouareconnectedtoanALMserverthatsupportsBPT.Theprocedures describedinthistutorialaredesignedforcreatingGUItests,butyoucanalsoapplythemajorityofthese procedurestocreatingkeyword-drivencomponents.Formoredetailsonbusinesscomponentsand BPT,seetheUnifiedFunctionalTestingUserGuideandtheBusinessProcessTestingUserGuide. Note:Unlessotherwisespecified,referencestoApplicationLifecycleManagementorALM applytoallcurrentlysupportedversionsofALMandQualityCenter. UnifiedFunctionalTesting(14.03) Page5of112 GUITestingTutorialforWebApplications WelcometotheUFTTutorialforGUITesting SomefeaturesandoptionsmaynotbesupportedinthespecificeditionofALMorQuality Centerthatyouareusing. UnifiedFunctionalTesting(14.03) Page6of112 Introducing Unified Functional Testing - GUI Testing for Web Applications ThislessonprovidesyouwithanoverviewofautomatedGUItestingandUFT,andgetsyousetupto performthetutorial. Note:Werecommendworkingwithansoftcopyofthistutorialbecausetherearesectionsin whichyouwillbeaskedtocopyandpasteteststepsintoUFT.However,keepinmindthatin selectedpartsofthistutorial,UFTwillberecordingyouroperationsorlearningobjectsthatyou pointtowiththemouse.Duringsuchsessions,youshouldrefrainfromswitchingfocustothe PDForHelpwindow. YoucanopenaPDFofthistutorialfromyour<UnifiedFunctional Testinginstallation>\help folder. YoucanaccesstheHTMLversionofthistutorial,byselectingHelp > UFT Help > UFTTutorials > GUITesting Tutorial forWeb Applications. Thischapterincludes: • BenefitsofAutomatedGUITesting 8 • TestingProcess 9 • UFTWindow 10 UnifiedFunctionalTesting(14.03) Page7of112 Benefits of Automated GUI Testing IfyouhaveevertestedapplicationsorWebsitesmanually,youareawareofthedrawbacksofmanual testing. Manualtestingistime-consumingandtedious,andrequiresaheavyinvestmentinhumanresources. Worstofall,timeconstraintsoftenmakeitimpossibletomanuallytesteveryfeaturethoroughlybefore theapplicationisreleased.Thisleavesyouwonderingwhetherseriousbugshavegoneundetected. AutomatedGUItestingwithUFTaddressestheseproblemsbydramaticallyspeedingupthetesting process.YoucancreateteststhatcheckallaspectsofyourapplicationorWebsite,andthenrunthese testseverytimeyoursiteorapplicationchanges. AsUFTrunstests,itsimulatesahumanuserbymovingthecursorinaWebpageorapplicationwindow, clickingGUIobjects,andenteringkeyboardinput.However,UFTdoesallthisfasterthananyhuman user. Benefits ofAutomatedTesting Fast Automatedtestsaresignificantlyfasterthanhumanusers. Reliable Testsperformpreciselythesameoperationseachtimetheyarerun,thereby eliminatinghumanerror. Repeatable YoucantesthowtheWebsiteorapplicationreactsafterrepeatedexecutionofthe sameoperations. Programmable Youcanprogramsophisticatedteststhatbringouthiddeninformation. Comprehensive YoucanbuildasuiteofteststhatcoverseveryfeatureinyourWebsiteor application. Reusable YoucanreusetestsondifferentversionsofaWebsiteorapplication,evenifthe userinterfacechanges. UnifiedFunctionalTesting(14.03) Page8of112 GUITestingTutorialforWebApplications IntroducingUnifiedFunctionalTesting-GUITestingforWebApplications Testing Process TheUFTtestingprocessconsistsofthefollowingmainphases: 1. Analyzing yourapplication. Thefirststepinplanningyourtestistoanalyzeyourapplicationtodetermineyourtestingneeds. l Whatare yourapplication'sdevelopmentenvironments?YouwillneedtoloadUFTadd-insfor theseenvironmentstoenableUFTtoidentifyandworkwiththeobjectsinyourapplication. ExamplesofdevelopmentenvironmentsincludeWeb,Java,and.NET. l Whatbusinessprocessesand functionalitydoyou wanttotest?Toanswerthis,thinkabout thevariousactivitiesthatcustomersperforminyourapplicationtoaccomplishspecifictasks. l Howcan you breakyourtestintosmall testable unitsand tasks? Youshouldbreakthe processesandfunctionalityyouwanttotestintosmallertasks,sothatyoucancreateUFT actionsbasedonthosetasks.Smallerandmoremodularactionsmakeyourtestseasiertoread andfollow,andhelpeasemaintenanceinthelongrun. Atthisstage,youcanalreadybegincreatingtestskeletonsandaddingactions. 2. Preparing the testing infrastructure. Basedonyourtestingneeds,youmustdeterminewhatresourcesarerequiredandcreatethese resourcesaccordingly. Examplesofresourcesincludeshared objectrepositories,whichcontaintestobjectsthatrepresent objectsinyourapplication,andfunction libraries,whichcontainfunctionsthatenhanceUFT functionality. YoualsoneedtoconfigureUFTsettingssothatUFTwillperformanyadditionaltasksyoumay youneed,suchasdisplayingaresultsreporteverytimeyourunatest. 3. Building yourtestsand adding stepstoeach test. Afterthetestinginfrastructureisready,youcanbeginbuildingyourtests. Youcancreateoneormoreemptytestsandaddactionstothemtocreatethetestingskeletons. Youassociateyourobjectrepositorieswiththerelevantactions,andassociateyourfunction librarieswiththerelevanttests,sothatyoucaninsertstepsusingkeywords. Youcanalsoaddallyourteststoasinglesolution.Asolutionenablesyoutostore,manage,and editanyrelatedteststogether,withouthavingtocloseonetestbeforeopeninganother. Youmayalsoneedtoconfiguretestpreferencesatthispoint. 4. Enhancing yourtest. l Youcantestwhetheryourapplicationisfunctioningcorrectlybyinsertingcheckpointsintoyour tests.Checkpointssearchforaspecificvalueofapage,object,ortextstring. Youcanbroadenthescopeofyourtestandtesthowyourapplicationperformsthesame l operationswithmultiplesetsofdata.Dothisbyreplacingfixedvalueswithparameters. UnifiedFunctionalTesting(14.03) Page9of112 GUITestingTutorialforWebApplications IntroducingUnifiedFunctionalTesting-GUITestingforWebApplications l Youcanaddothersophisticatedcheckstoyourtestbyaddingprogramming and conditional or loop statementsandotherprogramminglogictoyourtestusingVBScript. Thistutorialincludesstepsforcheckpointsandparametersonly.Foradditionaldetailsabout VBScriptstatements,seetheUnifiedFunctionalTestingUserGuide. 5. Debugging,running,and analyzing yourtest. Youcandebugyourtestusingdebuggingfunctionalitytoensurethatitoperatessmoothlyand withoutinterruption.Afterthetestisworkingcorrectly,yourunittocheckthebehaviorofyour application.Whilerunning,UFTopenstheapplicationandperformseachstepinyourtest. Examinetherunresultstopinpointdefectsinyourapplication. 6. Reporting defects. IfyouhaveALMinstalled,youcanreportthedefectsyoudiscovertoadatabase.ALMisthetest managementsolution. FordetailsaboutworkingwithALM,seetheApplicationLifecycleManagementUserGuide. UFT Window Beforeyoubegincreatingtests,familiarizeyourselfwiththemainUFTwindow. TakeafewminutestoexplorethecomponentsofthemainUFTwindow.Youcanthencontinueto analyzetheapplicationyouwillbetestinginthistutorial,asdescribedin"AnalyzingYourApplication andCreatingActions"onpage15. Document Types UFTdisplaysopendocumentsinthedocumentpane.Usethedocumenttabslocatedjustbelowthe toolbartonavigatetoopendocumentsandbringthemintofocus. Thedocumentpanecandisplaythefollowingtypesoffiles: l Tests.Youcancreate,view,andmodifyyourtestintheCanvas,whichenablesyoutoedittheflowof yourtest,action,orcomponent. l ActionsorBusinessComponents.Enablesyoutocreate,view,andmodifyyouractionorbusiness component,inthefollowingviews: l Keyword View.Containseachstep,anddisplaystheobjecthierarchy,inamodular,icon-based table. l Editor.ContainseachstepasaVBScriptline,displayedinatextandcodeeditor.Inobject-based steps,theVBScriptlinedefinestheobjecthierarchy. l Function Library.Enablesyoutocreate,view,andmodifyfunctions(operations)forusewithyour test.Functionlibrariesopenasseparatetabsinthedocumentpane,similartotestsoractions. l Application Areas.Enablesyoutoedittheapplicationareasettingsandresourceassociations. l StartPage.WelcomesyoutoUFTandprovideslinkstorecentfiles,descriptionsofnewfeatures, productforums,andothersupportlinks.Youcanusetheshortcutbuttonstoopennewandexisting documents. l ProductMovies.AccessiblefromtheStartPageorHelpmenu,andteachesyouaboutsomeofthe UnifiedFunctionalTesting(14.03) Page10of112
Description: