private TestObjectNurse FindMatchingNode(TestObjectNurse nodes, TestObjectNurse fromObjectNurse) { //_Logger.WriteLog(LogTypeEnum.Debug, () => UIAUtility.DumpAutomationElement(fromObjectNurse.AutomationElement)); bool startswithWebfrom = false; bool startswithWeb = false; foreach (TestObjectNurse repoChildNode in nodes.Children) { startswithWebfrom = fromObjectNurse.TestObject.ControlTypeString.StartsWith("Web"); startswithWeb = repoChildNode.TestObject.ControlTypeString.StartsWith("Web"); if (startswithWebfrom != startswithWeb) { continue; } if (startswithWebfrom) { if (WebUtility.AreEqual(repoChildNode.TestObject, fromObjectNurse.TestObject)) { return(repoChildNode); } continue; } if (UIAUtility.AreEqual(repoChildNode.TestObject, fromObjectNurse.TestObject)) //if (condition.Match(fromCondition.AutomationElement)) { return(repoChildNode); } } return(null); }