Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to create Userdefined Function.Please write the steps
ans also provide example where exatcly we use it.

Answer Posted / chandu

Hi,
u can create user defined functions in notepad by saving
the file with .vbs extention.
eg:
public function add
x= 20
y= 30
z= x+y
msgbox z
end function
paste the above code in notepad and save it as .vbs ext.
then go to QTP file>settings>resources tab
add the .vbs file there. and then write-- call add---in ur
QTp editor.the use of this is u can reuse the same function
wherever u want. so u can call it multiple times in ur
test.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Hai anyone please "Explain about Framework in QTP?"

2103


How do you know the location Id of an object if you know its index id?

993


How to save your test using quicktest professional (qtp)?

1048


I used the below code to open QTP through VBscript?But i can unable to Invoke QTP...PLZ help me with the correct code to invoke QTP through VBS with description of the code aswell. Dim qtApp 'As QuickTest.Application 'Declare the Application object variable Dim qtTest 'As QuickTest.Test 'Declare a Test object variable Dim qtResultsOpt 'Declare a Run Results Options object variable Set qtApp = CreateObject("QuickTest.Application") 'Create the Application object qtApp.Launch 'Start QuickTest qtApp.Visible = False 'Make the QuickTest application visible qtApp.Open "C:\form", True 'Open the test in read-only mode 'set run settings for the test Set qtTest = qtApp.Test qtTest.Run 'Run the test 'WScript.StdOut.Write "Status is: " & qtTest.LastRunResults.Status 'Check the results of the test run qtTest.Close 'Close the test qtApp.quit 'Close QuickTest Pro Set qtResultsOpt = Nothing 'Release the Run Results Options object Set qtTest = Nothing 'Release the Test object Set qtApp = Nothing 'Release the Application object

2853


How do you handle multiple banners(at the top the page, the banner is scrolling) in a web page(Dont take the name property(regular expression))

2070


What is the descriptive programming?

1952


Explain qtp(quick test professional)?

971


How to build scripts that access data from external sources?

2049


1.How do u prepare the test suits in QC? 2.How do u convert requirements to test plan in QC?

1905


What is active screen?

937


what is run-time data?

2138


What are the recording modes in wave event?

1955


what are all the fileds present in object repository?

1985


What is the difference between byref and byval in qtp?

1009


How are cgi programs, applets, javascripts, ActiveX components, etc. to be maintained, tracked, controlled, and tested?

1111