Identify Checkboxes value

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Juan
Posts: 19
Joined: Wed Jul 20, 2016 1:18 pm

Identify Checkboxes value

Post by Juan » Wed Jul 20, 2016 1:45 pm

Hi I have this scenario to test:
Scenario.png
I use my code to identify the checkbox but I don't know how to test its value. Spy detects same attributes in both cases
Checkbox_unchecked.png
Checkbox_checked.png
This is how I click a checkbox

Code: Select all

//Receive the div container where the checkbox label is
 private void CheckBoxValue(WebElement checkBox)
        {
            IList<LabelTag> inners = checkBox.FindDescendants<LabelTag>();
            foreach (LabelTag label in inners)
            {
                if (label.Class == "k-checkbox-label")
                {
                    label.Click();
                }
            }
        }
Any ideas of how to check the values? Thanks in advance
You do not have the required permissions to view the files attached to this post.

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

Re: Identify Checkboxes value

Post by Support Team » Thu Jul 21, 2016 1:24 pm

Hello Juan,

It seems both label tags have the same class name value. Maybe it is better to use another property. Please post a Ranorex Snapshot file. This will help us analyzing the issue in more detail.

Thank you.

Regards,
Bernhard