Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
qtp important Interview questions

qtp important Interview questions

Ratings: (0)|Views: 69|Likes:
Published by Verma Vicky
qtp important Interview questions
qtp important Interview questions

More info:

Categories:Topics, Art & Design
Published by: Verma Vicky on Mar 29, 2012
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

03/29/2012

pdf

text

original

 
RegisterUserFuncStatementEnablesyoutoaddnewmethodstotestobjectclassesorchangethebehaviorofanexistingtestobjectmethodduringarunsession.Whenyouusethisstatement,QuickTestusesyouruser-definedfunctionasamethodofthespecifiedtestobjectclassfortheremainderoftherunsession,oruntilyouunregisterthemethod.Ifthespecifiedmethodnamedoesnotalreadyexistforthetestobjectclass,itbecomesanewmethodforthetestobjectclass.IfthemethodnameisadefinedQuickTestmethodforthetestobjectclass,yourdefinition(temporarily)overridestheexistingfunctionalityofthespecifiedmethod.=============ImportantInformationAregisteredmethodappliesonlytothetestorlibraryfileinwhichyouregisterit(ortoanytestscallinganactioncontainingaRegisterUserFuncstatement).Fortests,ifyouregisterafunctionwithinareusableaction,itisrecommendedthatyouunregisterthemethodattheendoftheaction.(SeeUnregisterUserFuncStatement.)QuickTestclearsallfunctionregistrationsatthebeginningofeachrunsession.WhenQuickTestrunsaregisteredmethod,itsendsthetestobjectasthefirstargument.Forthisreason,anyuser-definedfunctionthatyouregisterasatestobjectmethodmusthaveatleastoneargument,whichreceivesthetestobject.Ifyouregisterauser-definedfunctiontooverrideanexistingtestobjectmethod,thenafterthetestobjectargument,thefunctionmusthavethesamenumberofargumentsasthemethoditoverrides.Formoreinformationonuser-definedfunctions,seetheHPQuickTestProfessionalUserGuide.=========================TOClassStringThetestobjectclassforwhichyouwanttoregisterthemethod.YoucannotregisteramethodforaQuickTestreservedobject(suchasRecover,Reporter,andtheotherobjectslistedintheUtilityObjectssectionoftheHPQuickTestProfessionalObjectModelReference).MethodNameStringThemethodyouwanttoregister.Themethodnamecannotcontainspaces.FunctionNameStringThenameofyouruser-definedfunction.Thefunctioncanbelocatedinyouractionorinanylibraryfileassociatedwithyourtestorcomponent.SetAsDefaultBooleanOptional.Indicateswhethertheregisteredfunctionisusedasthedefaultoperationforthetestobject.Default=FalseNote:WhenyouselectatestobjectintheKeywordVieworStepGenerator,thedefaultoperationisautomaticallydisplayedintheOperationcolumn(KeywordView)orOperationbox(StepGenerator).Formoreinformation,seetheHPQuickTestProfessionalUserGuide.ExamplesThefollowingexampleusestheRegisterUserFuncmethodtocreateanewCopymethodfortheWinEdittestobjectthatcopiesallthetextinaneditboxtotheWindowsClipboard.SubCopy(edit)Edit.Click3,3Edit.SetSelection0,Len(Edit.GetROProperty("text"))Edit.TypemicCtrlDwn+"c"+micCtrlUpEndSubRegisterUserFunc"WinEdit","Copy","Copy"
 
'NowyoucancallthenewmethodDialog("Login").WinEdit("AgentName:").CopyThefollowingexampleusestheRegisterUserFuncmethodtomodifythebehavioroftheWebEdit.SetmethodasdefinedintheMySetfunction.ThenewbehaviorenablestheSetmethodtoretrieveandreportthedefaultvalueoftheeditboxbeforethenewvalueisentered.FunctionMySet(obj,x)dimyy=obj.GetROProperty("value")Reporter.ReportEventmicDone,"previousvalue",yMySet=obj.Set(x)EndFunctionRegisterUserFunc"WebEdit","Set","MySet"Browser("MercuryTours").Page("FindFlights").WebEdit("Country").Set"Canada"UnRegisterUserFunc"WebEdit","Set"*******************************************ExecuteFileStatementExecutestheVBScriptstatementsinthespecifiedfile.Afterthefileruns,thedefinitions(functions,subroutines,classes,etc.)inthefileareavailablefromtheglobalscopeoftheaction'sscript.Note:YoucannotdebugafilethatiscalledusinganExecuteFilestatement,oranyofthefunctionscontainedinthefile.Inaddition,whendebuggingatestthatcontainsanExecuteFilestatement,theexecutionmarkermaynotbecorrectlydisplayed.********************************************LoadFunctionLibraryStatementLoadsthespecifiedfunctionlibrarywhenthisstepruns.ImportantInformationThefunctionlibraryisloadedonlywhenthestepruns(andnotwhenthetestorcomponentopens).Therefore:Thefunctionlibraryisnotlistedinthefollowing(exceptduringtherunsession):TheResourcespaneinQuickTest.TheMissingResourcespaneinQuickTest.TheCommentstabintheQuickTestToDopane.TheDependenciestabintheQualityCenterTestResourcesmodule.Thiscanaffecttestorcomponentmaintenancebecausethefunctionlibrarycanpotentiallybemodifiedordeletedwithoutanyonerealizingthatitiscalledbythistestorcomponent.Conversely,whenperformingmaintenanceonatestorcomponent,thisfunctionlibrarycanbeoverlookedbecauseitisnotclearlyvisibleasaresource.Ifafunctioninthefunctionlibraryhasthesamenameasafunctioninanassociatedfunctionlibrary(definedintheFolderspaneoftheOptionsdialogbox),thefunctioninthedynamicallyloadedfunctionlibraryisused.Similarly,ifmorethanonefunctionlibraryisloadeddynamically,andthesefunctionlibrarieseachcontainafunctionwiththesamename,QuickTestusesthefunctioninthelastloadedfunctionlibrary.Ifadynamicallyloadedfunctionlibrarydefinesandinitializesaglobalvariableoraclass,thevalueremainsineffectfortheremainderoftherunsessionoruntilanewvalueisdefined,whichevercomesfirst.Runperformancecanbeaffectedbecausethefunctionlibraryisloadedduringth
 
erunsession(andnotwhenthetestisopened).Attheendofarunsession,allofthefunctionlibrariesthatweredynamicallyloadedareunloaded.YoucanviewthestepsthatranduringtherunsessionintheRunResultswindow.SyntaxLoadFunctionLibrary(Path)ArgumentTypeDescriptionPathStringThepath(orpaths)ofthefunctionlibrarytoload.Youcanspecifyoneormoreabsolutefilesystempaths,relativepaths,orQualityCenterpathsforbothtestsandcomponents.Ifyouspecifymultiplepaths,separatethemusingacommadelimiter.ReturnValueVariant.Example1:Thefollowingexampleloadsfunctionlibrariesandrunsfunctions.DimstrCurrentLibPathConststrFrenchLibPath="[QualityCenter\Resources]Resources\QTPResources\French\"ConststrEnglishLibPath="[QualityCenter\Resources]Resources\QTPResources\English\"ConststrDefaultLibPath="[QualityCenter\Resources]Resources\QTPResources\Default\"'DeterminethefunctionlibrariestoloadduringtherunsessionIfEnvironment.Value("Language")="French"thenstrCurrentLibPath=strFrenchLibPathelseifEnvironment.Value("Language")="English"thenstrCurrentLibPath=strEnglishLibPathElsestrCurrentLibPath=strDefaultLibPathEndif'Loadtherelevantfunctionlibrariesforthecurrentenvironment'slanguageLoadFunctionLibrarystrCurrentLibPath+"DialogCrashChecks.qfl",strCurrentLibPath+"DialogL18NChecks.qfl"'PerformasetofwindowobjectchecksusingthePerformDialogCrashChecksfunctionfromtheDialogCrashChecks.qflfunctionlibraryloadedinthepreviousstepPerformDialogCrashChecksWindow("MyApplication")'PerformasetofwindowobjectchecksusingthePerformL18NDialogChecksfunctionfromtheDialogL18NChecks.qflfunctionlibraryloadedpreviouslyPerformL18NDialogChecksWindow("MyApplication")***************************************PrintStatementDescriptionDisplaysinformationintheQuickTestPrintLogwindowduringtherunsession.TheQuickTestPrintLogwindowremainsopenwhiletherunsessioncontinues,untilyoucloseit.Formoreinformation,seetheHPQuickTestProfessionalUserGuide.SyntaxPrint(Message)ArgumentTypeDescription

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->