how to get the 'checked' state of a checkbox or radio button

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

how to get the 'checked' state of a checkbox or radio button

Post by hobli » Wed May 19, 2010 7:01 am

Hi,

I am writing some code to check if a checkbox/radiobutton on a webpage is in checked state.
Here's the html code:
<input type="checkbox" name="chkbox name" value="chkbox 1 value" id="chkbox1">

Pls be noted that the attribute of "checked" is not defined in html.
when I tried with following code:
Dim chkBox as InputTag
chkBox = <rx path of the webelement>
Dim state as string
state = chkBox.Checked
It always return null.

is that correct? how to retrieve the run-time check state of the inputTag?

I am using ranorex studio 2.3

thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: how to get the 'checked' state of a checkbox or radio button

Post by Support Team » Wed May 19, 2010 11:39 am

Hi!
hobli wrote:is that correct? how to retrieve the run-time check state of the inputTag?
Yes you wrote the correct code. But at the moment this only works with Internet Explorer. We found a bug in the Firefox Add-on about this behavior. This bug fix will be released with the next Ranorex Version.

Thanks for posting the bug.

Regards,
Peter
Ranorex Support Team

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

Re: how to get the 'checked' state of a checkbox or radio button

Post by hobli » Wed May 19, 2010 2:55 pm

Hi, ranorex team,

thanks for your prompt reply. May I know when the next release with this bug fix will be available? As we are going to test web application for both IE and firefox, this bug will be quite important to us.

thanks

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: how to get the 'checked' state of a checkbox or radio button

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

Hi,
hobli wrote:May I know when the next release with this bug fix will be available?
The next service release will be released in June. But I cannot provide you with an exact date.

Regards,
Peter
Ranorex Support Team

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

Re: how to get the 'checked' state of a checkbox or radio button

Post by hobli » Fri May 21, 2010 8:59 am

Hi,

that's fine enough. thanks

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

Re: how to get the 'checked' state of a checkbox or radio button

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

hi,

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

checked state of inputTag can now be properly retrieved with FireFox and IE.