Test if Java CheckBox is checkes

338 views
Skip to first unread message

MatFreude

unread,
Nov 30, 2007, 4:13:41 AM11/30/07
to QTP - Mercury Quick Test Professional - Automated Software Testing
Hi there,

I use QTP with Java Add-In and I want to create a testset where I can
check if a specified Java CheckBox is checked or if not I want to
check the CheckBox.

My problem is that I can use the method Click to set the Checkbox as
checked, but then I don't if it was checked before or not.

So my question is how I can get the "Checked"-Value of these Java
Checkbox and how I can set it to checked?

Thanks in advise.

Matthias

Evren

unread,
Dec 3, 2007, 2:44:28 AM12/3/07
to QTP - Mercury Quick Test Professional - Automated Software Testing
If it's not checked its value will return zero. If it's checked its
value will return one.Did you ask about this?

If
JavaWindow("...").JavaCheckBox("CheckBox...").GetRoProperty("value")=0
Then 'It's not checked
JavaWindow("...").JavaCheckBox("CheckBox...").Set "ON"
End If
Reply all
Reply to author
Forward
0 new messages