Forum Discussion
Hi Alex,
You can try using a script similar to the example we have created. Before running the script, replace "<PageObject>" in the fifth code line with the actual name of the page displayed in your browser.
'VBScript
Sub Main
Dim PageObj, wTable, strText
Set PageObj = <PageObject>
set wTable = PageObj.NativeWebObject.Find("id", "ctl00_ContentPlaceHolder1_emailTypeRadioButton", "Table")
strText = "PlainText"
If checkItem(wTable, strText) Then
Log.Message "The '" & strText & "' button is in the '" & wState(wTable, strText) & "' state."
End If
End Sub
Function checkItem(wTable, strText)
Dim wCellRButton, wRButton
checkItem = False
Set wCellRButton = wTable.FindChild("innerText", "*" & strText & "*")
If Not wCellRButton.Exists Then
Log.Error "Wrong button text."
Exit Function
End If
Set wRButton = wCellRButton.RadioButton("*")
wRButton.Click
checkItem = True
End Function
Function wState(wTable, strText)
Dim wCellRButton, wRButton
wState = False
Set wCellRButton = wTable.FindChild("innerText", "*" & strText & "*")
If Not wCellRButton.Exists Then
Log.Error "Wrong button text."
Exit Function
End If
Set wRButton = wCellRButton.RadioButton("*")
wState = wRButton.checked
End Function
Related Content
- 2 years ago
- 4 years ago
- 3 years ago
Recent Discussions
- 22 hours ago