From 3621aaf8b0391869d66dae4e57756737942ec4ca Mon Sep 17 00:00:00 2001 From: Tyler Olson Date: Tue, 28 Apr 2020 17:26:53 -0500 Subject: [PATCH 1/3] Set/Get Header fixes --- .../Elements/Entity.cs | 2 +- ...ft.Dynamics365.UIAutomation.Api.UCI.csproj | 10 +---- .../WebClient.cs | 44 +++++++++++++++++-- .../packages.config | 2 - ...rosoft.Dynamics365.UIAutomation.Api.csproj | 9 ---- .../packages.config | 2 - ...ft.Dynamics365.UIAutomation.Browser.csproj | 9 ---- .../packages.config | 2 - 8 files changed, 43 insertions(+), 37 deletions(-) diff --git a/Microsoft.Dynamics365.UIAutomation.Api.UCI/Elements/Entity.cs b/Microsoft.Dynamics365.UIAutomation.Api.UCI/Elements/Entity.cs index 93d7dd67..fece5d7a 100644 --- a/Microsoft.Dynamics365.UIAutomation.Api.UCI/Elements/Entity.cs +++ b/Microsoft.Dynamics365.UIAutomation.Api.UCI/Elements/Entity.cs @@ -380,7 +380,7 @@ public void SetHeaderValue(string field, string value) /// The lookup field name, value or index of the lookup. public void SetHeaderValue(LookupItem control) { - _client.SetHeaderValue(control); + _client.SetHeaderValue(control); } /// diff --git a/Microsoft.Dynamics365.UIAutomation.Api.UCI/Microsoft.Dynamics365.UIAutomation.Api.UCI.csproj b/Microsoft.Dynamics365.UIAutomation.Api.UCI/Microsoft.Dynamics365.UIAutomation.Api.UCI.csproj index 89bccd89..ea9b19cc 100644 --- a/Microsoft.Dynamics365.UIAutomation.Api.UCI/Microsoft.Dynamics365.UIAutomation.Api.UCI.csproj +++ b/Microsoft.Dynamics365.UIAutomation.Api.UCI/Microsoft.Dynamics365.UIAutomation.Api.UCI.csproj @@ -108,6 +108,7 @@ + @@ -117,15 +118,6 @@ - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - \ No newline at end of file From 79175c1ba59509673afbf6f95733a8b037a81ef5 Mon Sep 17 00:00:00 2001 From: Tyler Olson Date: Tue, 28 Apr 2020 17:36:25 -0500 Subject: [PATCH 2/3] PR code cleanup --- Microsoft.Dynamics365.UIAutomation.Api.UCI/Elements/Entity.cs | 2 +- .../Microsoft.Dynamics365.UIAutomation.Api.UCI.csproj | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Microsoft.Dynamics365.UIAutomation.Api.UCI/Elements/Entity.cs b/Microsoft.Dynamics365.UIAutomation.Api.UCI/Elements/Entity.cs index fece5d7a..93d7dd67 100644 --- a/Microsoft.Dynamics365.UIAutomation.Api.UCI/Elements/Entity.cs +++ b/Microsoft.Dynamics365.UIAutomation.Api.UCI/Elements/Entity.cs @@ -380,7 +380,7 @@ public void SetHeaderValue(string field, string value) /// The lookup field name, value or index of the lookup. public void SetHeaderValue(LookupItem control) { - _client.SetHeaderValue(control); + _client.SetHeaderValue(control); } /// diff --git a/Microsoft.Dynamics365.UIAutomation.Api.UCI/Microsoft.Dynamics365.UIAutomation.Api.UCI.csproj b/Microsoft.Dynamics365.UIAutomation.Api.UCI/Microsoft.Dynamics365.UIAutomation.Api.UCI.csproj index ea9b19cc..322456b8 100644 --- a/Microsoft.Dynamics365.UIAutomation.Api.UCI/Microsoft.Dynamics365.UIAutomation.Api.UCI.csproj +++ b/Microsoft.Dynamics365.UIAutomation.Api.UCI/Microsoft.Dynamics365.UIAutomation.Api.UCI.csproj @@ -108,7 +108,6 @@ - From 4e311140c09a1aa17f8857fce4cec4d9a3bcf8bb Mon Sep 17 00:00:00 2001 From: Tyler Olson Date: Wed, 29 Apr 2020 12:05:37 -0500 Subject: [PATCH 3/3] Resiliency fix for updating Time value on DateTimeControl Fixing GetHeaderValue if Time value is present --- Microsoft.Dynamics365.UIAutomation.Api.UCI/WebClient.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Microsoft.Dynamics365.UIAutomation.Api.UCI/WebClient.cs b/Microsoft.Dynamics365.UIAutomation.Api.UCI/WebClient.cs index 46b7a904..f01b5434 100644 --- a/Microsoft.Dynamics365.UIAutomation.Api.UCI/WebClient.cs +++ b/Microsoft.Dynamics365.UIAutomation.Api.UCI/WebClient.cs @@ -2256,6 +2256,7 @@ private static void TrySetTime(IWebDriver driver, IWebElement timeField, string timeField.Clear(); timeField.Click(); timeField.SendKeys(time); + timeField.SendKeys(Keys.Tab); }, d => timeField.GetAttribute("value").IsValueEqualsTo(time), TimeSpan.FromSeconds(9), 3, @@ -2411,7 +2412,7 @@ internal BrowserCommandResult GetValue(string field) var timefields = driver.FindElements(By.XPath(AppElements.Xpath[AppReference.Entity.FieldControlDateTimeTimeInputUCI].Replace("[FIELD]", field))); if (timefields.Any()) { - text = $" {timefields.First().GetAttribute("value")}"; + text += $" {timefields.First().GetAttribute("value")}"; } } }