How do we create functions in qtp and call the functions?

Showing Answers 1 - 7 of 7 Answers

What ever the functions(one or many) you would like to write create in the notepad and save it as filename.vbs.Go to your test click on the testsettings in the TEST tab. Again go to the resources tab and click on the +(plus appears in green color) symbol and give the absolute path or u can browse.In the script where ever you want call using CALL funcName(parameters list).

  Was this answer useful?  Yes

Jenita

  • Feb 20th, 2007
 

You are upsolutely correct.Also if you want to execute file   Execute file and path name
Ex:Execute File C:Program FilesMercury InteractiveQuickTest ProfessionalTestslibrary1.vbs

  Was this answer useful?  Yes

tathagataM

  • Nov 25th, 2008
 

Function_F1(Dyna_link)
Set obj = Browser("Browser").Page("eProcurement_3").Link("Pending Approval for indent").Object.body.document
set Linkcollections= obj.Links

msgbox “No. of Links is” & Linkcollections.Length
dim counter
counter=0
For each Element in Linkcollections

StrTitle  = Element.GetROProperty (“title”)
If StrTitle = Expected_Title then
Element.Click
Exit For
Else
Counter = Counter + 1
End If

Next

End Function

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions