how to create user defined functions in QTP? can any one
expalin me with example..
Thanks in Advance for help
Answer Posted / manjunathareddy
User Defined functions nothing but A function which is not
related to project.
(Note :- Bulit in functions are Function which are Available
in QTP Library EX:- Len,StrComp etc,etc)
Example :- i will take zip folder function expample as user
defined function.
Function Zipfolder(oSource,oDestination)
On Error Resume Next
Err.CLear
Set Fso=CreateObject("Scripting.FileSystemObject")
Set oFile=Fso.OpenTextFile(oDestination,2,True)
oFile.Write "PK" &Chr(5)&Chr(6)&string(18,Chr(0))
oFile.Close
Set oShell=CreateObject("Shell.Application")
oShell.NameSpace(oDestination).CopyHere
oShell.NameSpace(oSource).Items
Do until
oShell.NameSpace(oDestination).Items.Count=oShell.NameSpace(oSource).Items.Count
WScript.Sleep 100
Loop
End Function
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is expert view and keyword view?
How to import a test case present in ".xls" file to TD under a Test set?
I have some real time based question.. 1.what are the challenges you have faced in your current project. 2.what are the bugs you found in your current project. 3.what are the strategies you follow to convert manual test cases into automation test cases. 4.how QTP identify two different browsers. 5. When you create a function library and share object repository what are the problems you have faced 6. How to solve the tool tip problem 7.what are the interesting bug you have found in your current project. 8.what is your daily work as a automation test engg. 9. how to create a weekly status report. 10. how many test cases you write,review and execute per day. 11.what are the uses of SQL in automation. 12.How to retrieve the data in html through vb script. 13.If application is very slow how to test the application in qtp.
what type of automation is follwed in the project?
If I change the object name in one action will it be updated in all the actions? Or not?
how to evalute defects in QTP script?
When do go for loop condition in test?
Describe how Smart Identification is used
For QTP Test Engineer, What is his contribution to the Project? Means, As as automation test engineer what is his role in the current project?
What is qtpro? What is quick test pro?
What is reusable action?
hi all can any body explain how to write the script for finding the mandatory fields which are having [red Astrik sign (*)]
What is the basic concept of quicktest professional?
write a script to validate the content in the web application. (do it by OR method) and (do it by Descriptive method by creating a description object..
What is the difference between run time object and test object in QTP?