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
Hi All , How can we decicde for pariticular frame(DataDriven or Keword Driven)in Project? Thanks Balaji
Hi Friends, Im planning to do certifcation in mercury Automation Tool QTP.But I Didnt get any clear details regarding course syllabus, fees, where to approach, and which certification would be useful for the experienced testers? can any one send me the details?
Object repositories types, which and when to use?
what function you write to do database testing with the help of qtp?
How did you resolve conflicts present in Object Repository?
I opened gmail login into gmail and i have to save (Pass or move) all the mail into notepad please give me code Thanks of all
Explain about Test Fusion Report of QTP?
Can any one send me the QTP Basic Coding Samples?
Explain different types of checkpoints?
can u explain the keyword driven framework with an example clearly how to create all the files and how to attach to main test.
1--How many functions u develop 2--What is an array 3-- where is ur server 4--U involved in unit testing 5--how ur test the background colour using QTP
How to find the difference between 2 dates in qtp?
Is it possible to change the property value at runtime? How it is possible?
Diff b/w test scenario's and test Procedures?
Define Error Pane of UFT?