From 8f1fd3a100211916e877bb8e6246baeb324b0a7d Mon Sep 17 00:00:00 2001 From: Khoa Nguyen Date: Thu, 9 Jan 2020 19:43:13 +1100 Subject: [PATCH 1/2] fixed issue with Lookup field not working for Quick Create form (#702) (#620) --- .../DTO/AppElementReference.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Dynamics365.UIAutomation.Api.UCI/DTO/AppElementReference.cs b/Microsoft.Dynamics365.UIAutomation.Api.UCI/DTO/AppElementReference.cs index 0c8d4453..4e0e8475 100644 --- a/Microsoft.Dynamics365.UIAutomation.Api.UCI/DTO/AppElementReference.cs +++ b/Microsoft.Dynamics365.UIAutomation.Api.UCI/DTO/AppElementReference.cs @@ -332,7 +332,7 @@ public static class AppElements { "Entity_LookupFieldResultList", "//*[contains(@data-id, '[NAME].fieldControl-LookupResultsDropdown_[NAME]_tab')]" }, { "Entity_LookupFieldResultListItem", "//*[contains(@data-id, '[NAME].fieldControl-LookupResultsDropdown_[NAME]_resultsContainer')]" }, { "Entity_LookupFieldHoverExistingValue", "//*[contains(@data-id, '[NAME].fieldControl-LookupResultsDropdown_[NAME]_SelectedRecordList')]" }, - { "Entity_TextFieldLookupFieldContainer", "//div[@role='tabpanel']/parent::*//*[contains(@data-id, '[NAME].fieldControl-Lookup_[NAME]')]" }, + { "Entity_TextFieldLookupFieldContainer", "//div[@data-id='[NAME].fieldControl-Lookup_[NAME]']" }, { "Entity_RecordSetNavigatorOpen", "//button[contains(@data-lp-id, 'recordset-navigator')]" }, { "Entity_RecordSetNavigator", "//button[contains(@data-lp-id, 'recordset-navigator')]" }, { "Entity_RecordSetNavList", "//ul[contains(@data-id, 'recordSetNaveList')]" }, From 7c22b1195d46b3d3b528f2cb71a056a64297d594 Mon Sep 17 00:00:00 2001 From: Khoa Nguyen Date: Thu, 9 Jan 2020 19:44:39 +1100 Subject: [PATCH 2/2] fixed issue with quick create form not interactable (#684) --- .../Extensions/SeleniumExtensions.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Microsoft.Dynamics365.UIAutomation.Browser/Extensions/SeleniumExtensions.cs b/Microsoft.Dynamics365.UIAutomation.Browser/Extensions/SeleniumExtensions.cs index ddb3c584..625e1aed 100644 --- a/Microsoft.Dynamics365.UIAutomation.Browser/Extensions/SeleniumExtensions.cs +++ b/Microsoft.Dynamics365.UIAutomation.Browser/Extensions/SeleniumExtensions.cs @@ -588,8 +588,15 @@ public static IWebElement WaitUntilAvailable(this IWebDriver driver, By by, Time try { - returnElement = wait.Until(d => d.FindElement(by)); - + var foundElements = wait.Until(d => d.FindElements(by)); + if (foundElements != null && foundElements.Count > 1) + { + returnElement = foundElements.FirstOrDefault(x => x.Displayed == true); + } + else + { + returnElement = foundElements.FirstOrDefault(); + } success = true; } catch (NoSuchElementException)