Steps to save Descriptive programming functions in QTP functional Library ?

344 views
Skip to first unread message

chiran

unread,
Apr 24, 2012, 4:08:02 AM4/24/12
to QTP - HP Quick Test Professional - Automated Software Testing
Hello Everyone,

I have just started learning Descriptive programming. I am practicing
with an application where we can create multiple functions and use
them in various places . I have wrote all the functions in the expert
view but if i want to write a driver script to only call those
functions , where I need to store all these functions.

Please help me ..

Thanks in advance
chiRan

Deepak Kumar Mahapatro

unread,
Apr 24, 2012, 7:01:21 AM4/24/12
to mercu...@googlegroups.com
copy the functions and paste in a vbs file. execute that in runtime and use the function names

chiRan

--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en



--
Regards,
Deepak

sujit kumar

unread,
Apr 24, 2012, 8:18:51 AM4/24/12
to mercu...@googlegroups.com
hi
Copy all function and store in .vbs file 
example:FunctionLibrary.vbs
c:\Library\FunctionLibrary.vbs

Now create new Test case
File->Setting->Resources->Click on + sign
Select ur function "c:\Library\FunctionLibrary.vbs"
Click on Ok button
now function added in ur scrip 
now u r free to use this function
check ur Function added or not
Resources->Associated Function Library


-- 
Thanks & Regards
Sujit


On Tue, Apr 24, 2012 at 1:38 PM, chiran <chiranch...@gmail.com> wrote:
chiRan

Anish Pillai

unread,
Apr 24, 2012, 11:11:12 AM4/24/12
to mercu...@googlegroups.com

chiran

unread,
Apr 24, 2012, 2:31:15 PM4/24/12
to mercu...@googlegroups.com
thanks alot to everyone..I have created one Function library and associated to current test. There you go , no problem now, only Playing with functions

thanks anyway guys ..

chiRan :)

Mitul Jani

unread,
Apr 24, 2012, 2:39:57 PM4/24/12
to mercu...@googlegroups.com
hi anish

how do i call this function from action 2 by just function name () or any other way

SearchDropBox() or any other way

On Tue, Apr 24, 2012 at 1:35 PM, Mitul Jani <mitul...@gmail.com> wrote:
Hi anish,

what did i wrong  and what is function definition
when i call this function it sys object not exist can you look please

Function SearchDropBox()
dim i,a
    With Browser("name:=Walmart.com: Save money. Live better.").Page("title:=Walmart.com: Save money. Live better.").WebList("name:=select","select type:=ComboBox Select","html tag:=com.wm.module.305715.select.0")
  If .Exist(4) Then
   a =.getRoProperty("items count")

  For i=0 to a-1
  .Select "#"&i
Next
End If
End With
End Function


Mitul Jani

unread,
Apr 24, 2012, 2:35:32 PM4/24/12
to mercu...@googlegroups.com
Hi anish,

what did i wrong  and what is function definition
when i call this function it sys object not exist can you look please

Function SearchDropBox()
dim i,a
    With Browser("name:=Walmart.com: Save money. Live better.").Page("title:=Walmart.com: Save money. Live better.").WebList("name:=select","select type:=ComboBox Select","html tag:=com.wm.module.305715.select.0")
  If .Exist(4) Then
   a =.getRoProperty("items count")

  For i=0 to a-1
  .Select "#"&i
Next
End If
End With
End Function

On Tue, Apr 24, 2012 at 10:11 AM, Anish Pillai <anish.pi...@gmail.com> wrote:

Deepak Kumar Mahapatro

unread,
Apr 24, 2012, 3:09:11 PM4/24/12
to mercu...@googlegroups.com
i tried this with amazon.com and it worked fine for me. just chk for the descriptions.
--
Regards,
Deepak

Mitul Jani

unread,
Apr 24, 2012, 5:39:28 PM4/24/12
to mercu...@googlegroups.com
how to use existing action
Reply all
Reply to author
Forward
0 new messages