set check state of an checkbox not working

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
hobli
Posts: 57
Joined: Thu Jul 30, 2009 1:15 am

set check state of an checkbox not working

Post by hobli » Thu May 20, 2010 4:38 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: set check state of an checkbox not working

Post by Support Team » Thu May 20, 2010 9:22 am

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
.
Image

hobli
Posts: 57
Joined: Thu Jul 30, 2009 1:15 am

Re: set check state of an checkbox not working

Post by hobli » Tue Jul 06, 2010 3:12 am

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"