Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private UITestControl SearchFromParent(UITestControl searchFor, UITestControl searchFrom)
- {
- UITestControl result = null;
- foreach (UITestControl Child in searchFrom.GetChildren())
- {
- Boolean match = true;
- foreach (PropertyExpression propertyInfo in searchFor.SearchProperties)
- {
- if (!(Child.GetProperty(propertyInfo.PropertyName).ToString().Equals(propertyInfo.PropertyValue.ToString())))
- {
- match = false;
- TestContextLogText("ERROR::MESSAGE::" + Child.GetProperty(propertyInfo.PropertyName).ToString() + " VS " + propertyInfo.PropertyValue.ToString());
- }
- }
- if(match)
- {
- return Child;
- }
- else
- {
- result = SearchFromParent(searchFor, Child);
- if(result!=null)
- {
- return result;
- }
- }
- }
- return null;
- }
Add Comment
Please, Sign In to add comment