Page 1 of 1

set check state of an checkbox not working

Posted: Thu May 20, 2010 4:38 am
by hobli
Dear ranorex team,

I am developing some code to 'check/uncheck' a checkbox in a webpage of IE browser.
I notice when I try the following code:

dim chkbox as Ranorex.inputTag

chkbox = "<rx path of the checkbox>"
chkbox.checked = "False"

but the attribute <checked> of chkbox is always 'True', and there's no exception thrown if before run the code, I manually check the chkbox on the webpage

However, the following code work properly if I manuall clear the chkbox on the webpage before execute the code:

chkBox.Checked = "True"

Please advise.

thanks

Re: set check state of an checkbox not working

Posted: Thu May 20, 2010 9:22 am
by Support Team
Hi,

If you want to set an input-tag to "False", you have to set an empty string to the checked state.
chkbox = "<rx path of the checkbox>"
chkbox.checked = ""
We know it's a bit confusing but we cannot change it because of backwards compatibility. It will be changed with the next major release of Ranorex.

Regards,
Peter
Ranorex Support Team

Re: set check state of an checkbox not working

Posted: Tue Jul 06, 2010 3:12 am
by hobli
HI,

this is just to confirm that this is fixed with ranorex 2.3.2.

following code will reset checkbox 'checked' state.

Code: Select all

dim chkbox as Ranorex.inputTag

chkbox = "<rx path of the checkbox>"
chkbox.checked = "False"