HP UFT Web Add-in Extensibility Software Version:12.52 Windows® operatingsystems Developer Guide DocumentReleaseDate:January2016 SoftwareReleaseDate:January2016 DeveloperGuide Legal Notices Warranty TheonlywarrantiesforHPproductsandservicesaresetforthintheexpresswarrantystatementsaccompanyingsuch productsandservices.Nothinghereinshouldbeconstruedasconstitutinganadditionalwarranty.HPshallnotbeliable fortechnicaloreditorialerrorsoromissionscontainedherein. Theinformationcontainedhereinissubjecttochangewithoutnotice. Restricted Rights Legend Confidentialcomputersoftware.ValidlicensefromHPrequiredforpossession,useorcopying.ConsistentwithFAR 12.211and12.212,CommercialComputerSoftware,ComputerSoftwareDocumentation,andTechnicalDatafor CommercialItemsarelicensedtotheU.S.Governmentundervendor'sstandardcommerciallicense. Copyright Notice ©Copyright1992-2016Hewlett-PackardDevelopmentCompany,L.P. TrademarkNotices Adobe®andAcrobat®aretrademarksofAdobeSystemsIncorporated. Google™andGoogleMaps™aretrademarksofGoogleInc. Intel®andPentium®aretrademarksofIntelCorporationintheU.S.andothercountries. Microsoft®,Windows®,Windows®XP,andWindowsVista®areU.S.registeredtrademarksofMicrosoftCorporation. OracleandJavaareregisteredtrademarksofOracleand/oritsaffiliates. Documentation Updates Thetitlepageofthisdocumentcontainsthefollowingidentifyinginformation: SoftwareVersionnumber,whichindicatesthesoftwareversion. l DocumentReleaseDate,whichchangeseachtimethedocumentisupdated. l SoftwareReleaseDate,whichindicatesthereleasedateofthisversionofthesoftware. l Tocheckforrecentupdatesortoverifythatyouareusingthemostrecenteditionofadocument,goto: http://h20230.www2.hp.com/selfsolve/manuals ThissiterequiresthatyouregisterforanHPPassportandsignin.ToregisterforanHPPassportID,goto: http://h20229.www2.hp.com/passport-registration.html OrclicktheNewusers-pleaseregisterlinkontheHPPassportloginpage. Youwillalsoreceiveupdatedorneweditionsifyousubscribetotheappropriateproductsupportservice.Contactyour HPsalesrepresentativefordetails. Support VisittheHPSoftwareSupportOnlinewebsiteat:http://www.hp.com/go/hpsoftwaresupport HPUFTWebAdd-inExtensibility(12.52) Page2 DeveloperGuide Thiswebsiteprovidescontactinformationanddetailsabouttheproducts,services,andsupportthatHPSoftware offers. HPSoftwareonlinesupportprovidescustomerself-solvecapabilities.Itprovidesafastandefficientwaytoaccess interactivetechnicalsupporttoolsneededtomanageyourbusiness.Asavaluedsupportcustomer,youcanbenefitby usingthesupportwebsiteto: Searchforknowledgedocumentsofinterest l Submitandtracksupportcasesandenhancementrequests l Downloadsoftwarepatches l Managesupportcontracts l LookupHPsupportcontacts l Reviewinformationaboutavailableservices l Enterintodiscussionswithothersoftwarecustomers l Researchandregisterforsoftwaretraining l MostofthesupportareasrequirethatyouregisterasanHPPassportuserandsignin.Manyalsorequireasupport contract.ToregisterforanHPPassportID,goto: http://h20229.www2.hp.com/passport-registration.html Tofindmoreinformationaboutaccesslevels,goto: http://h20230.www2.hp.com/new_access_levels.jsp HPSoftwareSolutionsNowaccessestheHPSWSolutionandIntegrationPortalWebsite.Thissiteenablesyouto exploreHPProductSolutionstomeetyourbusinessneeds,includesafulllistofIntegrationsbetweenHPProducts,as wellasalistingofITILProcesses.TheURLforthisWebsiteishttp://h20230.www2.hp.com/sc/solutions/index.jsp HPUFTWebAdd-inExtensibility(12.52) Page3 DeveloperGuide Contents Welcome toHP UFTWebAdd-inExtensibility 7 AbouttheUFTWebAdd-inExtensibilitySDK 7 AbouttheUFTWebAdd-inExtensibilityDeveloperGuide 8 AdditionalOnlineResources 9 Part 1:WorkingwithWebAdd-inExtensibility 11 Chapter1:IntroducingUFTWebAdd-inExtensibility 12 AboutUFTWebAdd-inExtensibility 13 ExtensibilityAccelerator 13 IdentifyingtheBuildingBlocksofWebAdd-inExtensibility 14 DecidingWhentoUseWebAdd-inExtensibility 15 AnalyzingtheDefaultUFTSupportandExtensibilityOptionsforaSampleCustom Control 17 UnderstandingHowtoImplementWebAdd-inExtensibility 21 WebAdd-inExtensibilitySamples 22 Chapter2:PlanningUFTSupportforYourToolkit 24 AboutPlanningUFTSupportforYourToolkit 25 PreparingtoCreateSupportforaCustomToolkit 25 DeterminingtheToolkitRelatedInformation 26 DeterminingtheSupportInformationforEachCustomControlType 26 UnderstandingtheWebAdd-inExtensibilityPlanningChecklist 27 WebAdd-inExtensibilityPlanningChecklist 29 WhereDoYouGofromHere? 30 Chapter3:DevelopingSupportforYourToolkit 31 AboutCustomToolkitSupport 32 DevelopingBrowser-IndependentSupport 32 CreatingaCustomToolkitSupportSet 33 UnderstandingtheTestObjectConfigurationFile 34 HowUFTLoadstheTestObjectConfigurationXML 38 UnderstandingHowUFTMergesTestObjectConfigurationFiles 38 ExtendinganExistingTestObjectClass 40 ProvidingaHelpFileforCustomizedTestObjectClasses 42 UnderstandingtheToolkitConfigurationFile 43 DesigningJavaScriptFunctionsforYourToolkitSupportSet 45 GlobalJavaScriptMethodsandUtilityMethods 49 HPUFTWebAdd-inExtensibility(12.52) Page4 DeveloperGuide Example: UsingSiblingControlstoIdentifyanObject 50 TeachingUFTtoIdentifytheTestObjectClasstoUseforaCustomWebControl 52 UsingtheConditionsElements 54 UsingtheContainerAttribute 58 TestingtheToolkitSupportSetDuringDevelopment 60 LoggingandDebuggingtheCustomSupport 63 UsingtheMicrosoftWindowsEventLog 63 DebuggingYourJavaScriptFiles(InternetExplorerOnly) 65 ImplementingSupportforTestObjectMethods 66 SupportingDynamicListsofValuesforMethodArguments 67 ImplementingSupportforIdentificationProperties 70 CustomizingtheTestObjectName 71 ImplementingaFilterforLearningChildControls 72 ImplementingSupportforRecording 74 TroubleshootingandLimitations-DevelopingSupport 76 Chapter4:DeployingtheToolkitSupportSet 79 AboutDeployingtheCustomToolkitSupport 80 DeployingtheCustomToolkitSupport 80 SettingstoUseDuringDesignStages 82 ModifyingDeployedSupport 82 ModifyingIdentificationPropertyAttributesinaTestObjectConfigurationFile 82 RemovingDeployedSupport 84 Part 2:Tutorial:LearningtoCreate WebCustom Toolkit Support 85 Chapter5:LearningtoCreateUFTSupportforaSimpleCustomWebControl 86 PreparingforThisLesson 87 PlanningSupportfortheWebAdd-inExtensibilityBookSampleToolkit 87 WebAdd-inExtensibilityPlanningChecklist 92 DevelopingtheToolkitSupportSet 94 Stage1:CreatingtheToolkitSupportSet 94 Stage2:IntroducingtheWebExtSampleEnvironmenttoUFT 95 DesigningtheToolkitConfigurationFile 95 DesigningtheTestObjectConfigurationFile 96 Stage3:TeachingUFTtoIdentify,Spy,andLearntheBookControl 97 DeployingandTestingtheToolkitSupportSet(forStage3) 99 Stage4:ImplementingSupportfortheWebExtBook'sTestObjectMethods 102 DeployingandTestingtheToolkitSupportSet(forStage4) 104 Stage5:ImplementingSupportfortheWebExtBook'sIdentificationProperties 105 HPUFTWebAdd-inExtensibility(12.52) Page5 DeveloperGuide DeployingandTestingtheToolkitSupportSet(forStage5) 106 Stage6:ChangingtheNameoftheTestObject 107 DeployingandTestingtheToolkitSupportSet(forStage6) 108 Stage7:ImplementingaFiltertoPreventLearningChildObjects 108 DeployingandTestingtheToolkitSupportSet(forStage7) 109 Stage8:ImplementingSupportforRecordingontheBookControl 110 DeployingandTestingtheToolkitSupportSet(forStage8) 112 Stage9:ImplementingSupportforDynamicListofValuesforAuthorName 113 DeployingandTestingtheToolkitSupportSet(forStage9) 115 LessonSummary 115 WhereDoYouGofromHere? 115 Chapter6:LearningtoCreateUFTSupportforaComplexCustomWebControl 117 PreparingforThisLesson 118 PlanningSupportfortheWebAdd-inExtensibilitySampleUsedBooksControl 118 WebAdd-inExtensibilityPlanningChecklist 122 DevelopingtheToolkitSupportSet 124 Stage1:ExpandingtheToolkitSupportSettoSupportanAdditionalControl 124 Stage2:TeachingUFTtoIdentify,Spy,andLearntheUsedBooksControl 125 DeployingandTestingtheToolkitSupportSet(forStage2) 127 Stage3:ImplementingSupportfortheWebExtUsedBooksTestObjectMethods 129 DeployingandTestingtheToolkitSupportSet(forStage3) 131 Stage4:ImplementingSupportfortheWebExtUsedBooksIdentificationProperties andtheTestObjectName 132 DeployingandTestingtheToolkitSupportSet(forStage4) 132 Stage5:ImplementingaFiltertoPreventLearningChildObjects 133 DeployingandTestingtheToolkitSupportSet(forStage5) 134 Stage6:ImplementingSupportforRecordingontheUsedBooksControl 134 DeployingandTestingtheToolkitSupportSet(forStage6) 135 LessonSummary 136 WhereDoYouGofromHere? 136 SendUsFeedback 138 HPUFTWebAdd-inExtensibility(12.52) Page6 Welcome to HP UFT Web Add-in Extensibility HP UFTWebAdd-inExtensibilityisanSDK(SoftwareDevelopmentKit)packagethatenablesyouto supporttestingapplicationsthatusethird-partyandcustomWebcontrolsthatarenotsupportedout- of-the-boxbytheUFTWebAdd-in. ExtensibilitycanalsobeusedtoenableHP Sprinter,HP'ssolutionforefficientandeffectivemanual testing,tolearnWebobjectsthatarenotsupportedout-of-the-box.Formoreinformationabout Sprinter,seetheHPSprinterUserGuide. Thischapterincludes: • AbouttheUFTWebAdd-inExtensibilitySDK 7 • AbouttheUFTWebAdd-inExtensibilityDeveloperGuide 8 • AdditionalOnlineResources 9 About the UFT Web Add-in Extensibility SDK InstallingExtensibilityAcceleratorforHPFunctionalTestingalsoinstallstheUFTWebAdd-in ExtensibilitySDK,whichprovidesthefollowing: AnAPI thatenablesyoutoextendtheUFTWebAdd-intosupportcustomWebcontrols. l TheWebAdd-inExtensibilityHelp,whichincludesthefollowing: l Adeveloperguide,includingastep-by-steptutorialinwhichyoudevelopsupportforasample l customcontrol. APIReferences. l AToolkitConfigurationSchemaHelp. l TheUFTTestObjectSchemaHelp. l TheHelpisavailablefromStart>All Programs >HP Software >HPUnifiedFunctional Testing> Extensibility >Documentation Aprinter-friendlyAdobeportabledocumentformat(PDF)versionofthedeveloperguide(availablein l the<Extensibility Acceleratorinstallation>\helpfolder). WebAdd-inExtensibilitytoolkitsupportsetsthatextendUFT GUItestingsupportforthefollowing l Web2.0environments: ASP.NETAJAXcontroltoolkit l GoogleWebToolkit l HPUFTWebAdd-inExtensibility(12.52) Page7 YahooUserInterface l Dojo l AsampleWebtoolkitthatincludescontrolsnamedBookandUsedBooksTable(ifyouinstall l ExtensibilityAccelerator). Accessing UFT Web Add-in Extensibilityin Windows8 Operating Systems UFTfilesthatwereaccessiblefromtheStartmenuinpreviousversionsofWindowsareaccessiblein Windows8fromtheStartscreenortheAppsscreen. Applications (.exe files).YoucanaccessUFTapplicationsinWindows8directlyfromtheStart l screen.Forexample,tostartUFT,double-clicktheHP UnifiedFunctional Testingshortcut. Non-program files.YoucanaccessdocumentationfromtheAppsscreen. l Note: AsinpreviousversionsofWindows,youcanaccesscontextsensitivehelpinUFTby pressingF1,andaccesscompletedocumentationandexternallinksfromtheHelpmenu. About the UFT Web Add-in Extensibility Developer Guide ThisguideexplainshowtosetupUFTWebAdd-inExtensibilityanduseittoextendUFT GUItesting supportforthird-partyandcustomWebcontrols. ThisguideassumesyouarefamiliarwithUFTfunctionality,andshouldbeusedtogetherwiththe followingdocuments,providedintheWebAdd-inExtensibilityHelp(Start>All Programs >HP Software >HP UnifiedFunctional Testing>Extensibility >Documentation>WebAdd-inExtensibility Help): APIReferences l ToolkitConfigurationSchemaHelp l TestObjectSchemaHelp l ThesedocumentsshouldalsobeusedinconjunctionwiththefollowingUFT documentation,available withtheUFTinstallation(Help>HP UnifiedFunctional TestingHelpfromtheUFTmainwindow): HPUnifiedFunctionalTestingUserGuide l TheWebsectionoftheHPUnifiedFunctionalTestingAdd-insGuide l HPUFTObjectModelReferenceforGUITesting l HPUFTWebAdd-inExtensibility(12.52) Page8 Note: Theinformation,examples,andscreencapturesinthisguidefocusspecificallyonworkingwith UFT GUItests.However,alltoolkitsupportsetsdevelopedusingtheWebAdd-inExtensibilitycan alsobeusedtoextendSprinter'scapabilitiestosupportWebcontrolsthatarenotsupportedout- of-the-box.AllreferencestoUFTinthisguideapplytobothUFTandSprinter. Additionally,muchoftheinformationinthisguideappliesequallytocomponents. BusinesscomponentsarepartofHPBusinessProcessTesting.Formoreinformation,seethe HPUnifiedFunctionalTestingUserGuideandtheHPBusinessProcessTestingUserGuide. WhenworkinginWindows8,accessUFTdocumentationandotherfilesfromtheAppsscreen. Toenableyoutosearchthisguidemoreeffectivelyforspecifictopicsorkeywords,usethefollowing options: AND,OR,NEAR,andNOTlogicaloperators.Availablefromthearrownexttothesearchbox. l Searchpreviousresults.AvailablefromthebottomoftheSearchtab. l Matchsimilarwords.AvailablefromthebottomoftheSearchtab. l Searchtitlesonly.AvailablefromthebottomoftheSearchtab. l Tip: WhenyouopenaHelppagefromthesearchresults,thestringforwhichyousearchedmaybe includedinacollapsedsection.Ifyoucannotfindthestringonthepage,expandallthedrop-down sectionsandthenuseCtrl-Ftosearchforthestring. Tocheckforrecentupdates,ortoverifythatyouareusingthemostrecenteditionofadocument,go totheHPSoftwareProductManualsWebsite(http://h20230.www2.hp.com/selfsolve/manuals). Additional Online Resources Thefollowingadditionalonlineresourcesareavailable: Resource Description Troubleshooting TheTroubleshootingpageontheHPSoftwareSupportWebsitewhereyoucansearchtheSelf-solve &Knowledge knowledgebase.TheURLforthisWebsiteishttp://h20230.www2.hp.com/troubleshooting.jsp. Base HPSoftware TheHPSoftwareSupportWebsite.ThissiteenablesyoutobrowsetheSelf-solveknowledgebase.You Support canalsoposttoandsearchuserdiscussionforums,submitsupportrequests,downloadpatchesand updateddocumentation,andmore.TheURLforthisWebsitewww.hp.com/go/hpsoftwaresupport. MostofthesupportareasrequirethatyouregisterasanHPPassportuserandsignin.Manyalso l requireasupportcontract. Tofindmoreinformationaboutaccesslevels,goto:http://h20230.www2.hp.com/new_access_ l levels.jsp HPUFTWebAdd-inExtensibility(12.52) Page9 Resource Description ToregisterforanHPPassportuserID,goto:http://h20229.www2.hp.com/passport- l registration.html HPSoftware TheHPSoftwareWebsite.Thissiteprovidesyouwiththemostup-to-dateinformationonHPSoftware Website products.Thisincludesnewsoftwarereleases,seminarsandtradeshows,customersupport,andmore. TheURLforthisWebsiteiswww.hp.com/go/software HPUFTWebAdd-inExtensibility(12.52) Page10
Description: