Page 1 of 1

Identify Checkboxes value

Posted: Wed Jul 20, 2016 1:45 pm
by Juan
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

Re: Identify Checkboxes value

Posted: Thu Jul 21, 2016 1:24 pm
by Support Team
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