1) Is this possible with a recording, or has to be scripted?
2) For an example of the type of control - Internet Explorer -> Internet Options -> Advanced Tab.
Let's say we have this TreeView and all its TreeItem set with correct checkbox status, I was able to capture this, and save it in repository.
Can I use that now to compare the checked value, against the saved one.
Something like this, but I want to validate all items, not just one:
Validate.Attribute(repo.Iexplore1.Tree14391.AllowActiveContentFromCDsToRunOnInfo, "Checked", "True");
Validate State of all checkbox items in TreeView Control
-
- Posts: 1
- Joined: Tue Dec 23, 2014 4:34 am
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Validate State of all checkbox items in TreeView Control
Hello chentiangemalc,
It's not possible to test multiple elements within one validation action. In order to do so, you could use following code:
Regards,
Robert
It's not possible to test multiple elements within one validation action. In order to do so, you could use following code:
Tree tree = "pathToTreeElement"; var treeSections = tree.FindDescendants<TreeItem>(); foreach(var section in treeSections) { var checkBoxes = section.FindDescendants<TreeItem>(); foreach(var checkBox in checkBoxes) { string message = String.Format("Validating {0}", checkBox.Text); Validate.Attribute(checkBox, "Checked", "True", message,false); } }Hope this information helps.
Regards,
Robert