Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function to create web objects (like Browser, Link, Page, etc)
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
I could not find any issues in the script except that
Code:
Public Function createSingleObj(t, p, val)
Set o = Description.Create
o("micclass").Value = t
o(p).Value = val
Set createBrwsrObj= o
End Function
Set createBrwsrObj = o it should be Set createSingleObj = 0.
I assume you want to return to the calling function.

Also,
It would be better if you pass the property and values in an array so that you can pass n no of Prop Value pairs you want. You will not be limited to use just 1 Prop and value.

Code:
createSingleObj("Browser","CreationTime:=0,title:=AOL.*")

Public Function createSingleObj(t,arrPV)
        Set o = Description.Create
        o("micclass").Value = t
        arrPV = Split(arrPV,",")
        For iLoop = 0 to UBound(arrPV)
                Prop= Split(arrPV(iLoop),":=")(0)
                Val= Split(arrPV(iLoop),":=")(1)
                o(Prop).Value = Val
        Next
        Set createSingleObj = o
End Function


Reply


Messages In This Thread
RE: Function to create web objects (like Browser, Link, Page, etc) - by vIns - 04-03-2012, 06:45 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can QTP handle slick grid table in a web page qtplearner88 2 4,491 10-01-2019, 10:44 AM
Last Post: shilpi952
  Child Object Not able to identified in Web Menu Link noor 0 1,857 01-21-2018, 04:44 PM
Last Post: noor
Question Is there a way to create dynamic objects by declaring the type of object as parameter lotos 3 2,181 11-08-2017, 11:15 PM
Last Post: lotos
  DP Web Browser/Page issues rstimers 1 2,435 08-14-2015, 12:37 PM
Last Post: venkatesh9032
  Calling a Function in Function Library when function is defined in an Action jitenderkkr 0 2,966 11-27-2014, 12:53 PM
Last Post: jitenderkkr

Forum Jump:


Users browsing this thread: 1 Guest(s)