projectrequirement:1.projecthastobemobile,meaningnohardcodedpath.usingenvironment:Environment("TestDir")togetthecurrenttestdirectory.Constructurthedirectorylikethisc:MercuryTourforscripts,C:mercuryTourDatatablefordatatables,c:mercurytourobjectrepositoryforobjectrepository,c:mercuryTourresultsforsavedtestresult#mainscript
#getthepathes
filepath=Environment("TestDir")
datatablepath=filep...[
阅读全文]
IntroductiontoDescriptiveProgramming.
HowtowriteDescriptiveProgramming?
WhenandWheretouseDescriptiveprogramming?
SomepointstonotewithDescriptiveProgramming.
IntroductiontoDescriptiveProgramming:
Descriptiveprogrammingisusedwhenwewanttoperformanoperationonanobjectthatisnotpresentintheobjectrepository.Therecanbevariousvalidreasontodoso.Wewilldiscussthemlaterinthisarticle.
How...[
阅读全文]
第一次接触是一朋友的。小小的土黄色胶。朋友说最好与果汗一起喝下去。后来我了一下,知道它并不是特别危险的药物。多年前用于治疗抑,只是后来被越来越多的人用来party,才被禁的。在youtube上有一段abc的采访视频,被采访者无不说它是重要的。但老外通常都是容易极端,谁知道他们是不是真的需要还是只想high。我的一个朋友曾经告诉我他在用了后,曾几次想自杀。比[
阅读全文]
GenericLibrary:
f_SelectFile(sFilePath,sFilePathandName)
ThisfunctionreturnstheselectfilenameanditspaththroughsFilePathandName.sFilePathisfordefaultfilepath.f_CreateFolder(sFolderPath,sFolderName)
ThisfunctionreturnsTrueifthenewfolderwascreated.
f_GetCurrentTime(iTimeformat,dCurrentTime)
Thisfunctionreturnsthecurrenttimein12h(1)or24h(2)format.12:01:01AMor23:45:23PMf_GetCurrentD...[
阅读全文]
DefineapublicfunctiontoacceptuserenteredURLandsaveditinanenvironmentvariable.InSetupAction:
Environment.Value("userEnteredURL")=UserInputURL()InPublicFunctionlibrary:
'@DescriptionAcceptuserinputURL
PublicFunctionUserInputURL()
UserInputURL=Inputbox("PleaseentertheURLyouwanttotest.","EnterTestingURL","http://newtours.demoaut.com/")
EndFunctionStringfunctions:
Defineafunctio...[
阅读全文]
QTPexamquestions:Afterturningoffexternalreuseableaction:yougetwarningmessagefromwhere(orwhatkindofmessage)?Howtorecordinlowleveloranalogmode:ClickRecord,thenclickLowleveloranalogbuttonorselectAutomaton--Recording,select-lowlevelrecordingoranalogrecording.Howtocreateindependentornetstedactions?splitanaction.Activescreendefaultcapturelevel:partialDefinenewtestobject:forplannedapplicationupdateorfunc...[
阅读全文]
ManagingObjectsNote:ThefunctionalitydescribedinthissectionisavailableintheObjectRepositorywindowforthelocalobjectrepository,andtheObjectRepositoryManagerforsharedobjectrepositories.Adding,Defining,Deleting,CopyingTestObjects
1.AddingandDeletingTestObjectsinaLocalorSharedObjectRepository
YoucanusetheNavigateandLearnoption,forexample,toaddobjectstothesharedobjectrepositoryaccordingtoyourdefi...[
阅读全文]
RegularExpressionsOverview
QuickTestenablesyoutoconfigurethevaluesforpropertiesandotheritemsbydefiningavalueasaconstantoraparameter.Youcanalsouseregularexpressionsforsomevaluestoincreasetheflexibilityandadaptabilityofyourtests.
Aregularexpressionisastringthatspecifiesacomplexsearchphrasebyusingspecialcharacters.Regularexpressionsareusedtoidentifyobjectsandtextstringswithvaryingvalues.
...[
阅读全文]
User-DefinedFunctionsandFunctionLibrariesAfunctionlibraryisaseparateQuickTestdocumentthatcontainsVisualBasicscript.AnytextfilewritteninstandardVBScriptsyntaxcanbeusedasafunctionlibrary.Yourfunctionlibrariescancontain:Functiondefinitions(functionsignatureandcode).Youcancallthesefunctionsfromotherfunctionsorfromanactioninyourtestafteryouassociatethefunctionlibrarywiththetest.VBScriptstatements.These...[
阅读全文]
ProgramminginExpertViewProgrammaticDescriptions
WhenQuickTestlearnsanobjectinyourapplication,itaddstheappropriatetestobjecttotheobjectrepository.Aftertheobjectexistsintheobjectrepository,youcanaddstatementsintheExpertViewtoperformadditionaloperationsonthatobject.YoucanalsoinstructQuickTesttoperformoperationsonobjectswithoutreferringtotheobjectrepositoryortotheobject’sname.Todothis,youprovideQ...[
阅读全文]