Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with function call
#3
Solved: 11 Years, 4 Months ago
Hi Vijay,

When you attempt to create an object collection with the index as one of the defining properties, you're limiting the size of the object collection as well as stating that you're certain of the object to be retrieved through the use of the ordinal identifier. If you remove the below line of code, and create your function, you should see better results.

Code:
WbButton("Index").Value = 1

Secondly, you can improve performance in your code if you use the property within the description object instead of looping through all items and finding the button with the correct name. Since your code clicks the first found WebButton, wouldn't it be better to limit your code to the following:

Code:
Set WbButton = Description.Create()
WbButton("micclass").Value = "WebButton"
WbButton("name").Value = strName
        
Set AllWbButton = Browser("micclass:=browser").page("micclass:=page").ChildObjects(WbButton)

AllWbButton(0).Click

Lastly, the below lines of code:

Code:
If WBname = strName Then
ClickWebButton = True

should be:

Code:
If WBname = strName Then
ClickWebButton = True

I hope this helps.
Correction in my last statement:

Lastly, the below lines of code:

Code:
If WBname = strName Then
WbButtonFound = True

should be:

Code:
If WBname = strName Then
ClickWebButton = True
Reply


Messages In This Thread
Problem with function call - by vijay44 - 01-27-2010, 11:37 AM
RE: Problem with function call - by Saket - 01-27-2010, 02:42 PM
RE: Problem with function call - by Anshoo Arora - 01-28-2010, 08:52 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problem With conversion function wajid 3 1,751 10-01-2018, 01:16 PM
Last Post: wajid
  Calling a Function in Function Library when function is defined in an Action jitenderkkr 0 2,977 11-27-2014, 12:53 PM
Last Post: jitenderkkr
  Run Error on Function call in QTP essentials cnujonnala 1 2,325 12-31-2012, 02:38 PM
Last Post: krr
  How can we call a function stored in another test ? akhilsoni776 2 3,797 08-25-2011, 10:47 PM
Last Post: akhilsoni776
  call function from another library y1799 2 5,562 08-19-2010, 06:43 PM
Last Post: y1799

Forum Jump:


Users browsing this thread: 1 Guest(s)