I'm wondering if it's possible to address a page element micclass using a variable.
For instance, to get a property on a link i can say
or in my case, the micclass and property to get come in a variable. So i'm looking for an address that is similar to the above, but allows me to use the var value for the .Link
I notice that there are multiple ways to address a page object, but so far haven't been able to use any of them. Can anybody make a suggestion?
I know i can create a switch based on all possible values for micclass but i'd like to do it in as few lines of code as possible, and a giant switch with 10 cases is a lot of lines of code. Plus it's not expandable if ever a class is added or removed.
Thanks.
For instance, to get a property on a link i can say
Code:
set oDesc = Description.Create
oDesc("micclass")="link"
oDesc("name") = "click here"
Browser(oBrowser).Page(oPage).Link(oDesc).getROProperty("outerhtml")
or in my case, the micclass and property to get come in a variable. So i'm looking for an address that is similar to the above, but allows me to use the var value for the .Link
Code:
vclass = "link"
vname = "click here"
vproperty = "outerhtml"
set oDesc = Description.Create
oDesc("micclass")=vclass
oDesc("name") = vname
Browser(oBrowser).Page(oPage).VCLASS(oDesc).getROProperty(vproperty)
I notice that there are multiple ways to address a page object, but so far haven't been able to use any of them. Can anybody make a suggestion?
I know i can create a switch based on all possible values for micclass but i'd like to do it in as few lines of code as possible, and a giant switch with 10 cases is a lot of lines of code. Plus it's not expandable if ever a class is added or removed.
Thanks.