Monday, 18 July 2011

Finds all the checkboxes in the parent object and clicks on them

'Finds all the checkboxes in the parent object and clicks on them all.

'Example : ClickAllCheckBoxs(Browser("BrwNAME"),"on")

Sub ClickAllCheckBoxs(object,to_do)

Rem: Creates the checkbox description object

set CheckDesc = Description.Create()

CheckDesc("micclass").Value = "WebCheckBox"

'More values can be added here such as

CheckDesc("disabled").Value = 0

'Check on for checkbox

if (to_do = "on") then

to_do ="on"

Else

to_do = "off"

End if

Set list = object.ChildObjects(CheckDesc)

'Run on all enabled checkbox's and click on them

For i=0 to list.count -1

list(i).set to_do

Next

End Sub

No comments:

Post a Comment