private void _CollapseReassignMenus(AT reassignDropdown) { try { while (true) { var all = reassignDropdown.GetElementsAllChild(returnNullWhenException: true).GetATCollection(); if (!all.Any((x) => x.GetElementInfo().Name().Equals(MPObj.ReassignCatalogListItem.Name))) { break; } for (var i = 0; i < all.Length; i++) { if (!all[i].GetElementInfo().Name().Equals(MPObj.ReassignCatalogListItem.Name)) { continue; } all[i - 1].DoClickPoint(0.5); break; } } } catch (Exception e) { throw new Exception("Failed to _CollapseReassignMenus. " + e.Message); } }