03-25-2010, 02:05 AM
use DP to search for the text of the checkbox to set, then the name won't matter.
the above code might not be perfect. I have 5 or 6 functions in a framework that combine functionality to return arrays of objects from the pages and then make decisions on which one I am looking for based on multiple critieria, so I had to strip all that down into this simple code. Hope this helps and points you in the right direction.
Code:
Dim chkobj
Set chkobj= Description.Create()
chkobj("html tag").Value = "input"
chkobj("type").Value = "checkbox"
chkobj("text").Value = "" 'text you need here...removing this will return all checkboxes on a page as an array that you can loop through below.
dim myobjs
set myobjs = Browser("Browser").Page("Page").ChildObjects(chkobj)
myobjs.set "ON" 'change to myobjs(id).Set "ON" if returning an array of objects.