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
Scenario.png (4.58 KiB) Viewed 704 times
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_unchecked.png (84.56 KiB) Viewed 704 times
Checkbox_checked.png
Checkbox_checked.png (86.59 KiB) Viewed 704 times
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

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

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