Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception with Lookup Functions when more than one record has the same value #40

Closed
troyyer opened this issue Oct 12, 2017 · 1 comment

Comments

@troyyer
Copy link

troyyer commented Oct 12, 2017

I noticed that if a lookup result has results with the same value, the function will fail with the error 'An item with the same key has already been added.' I have a Lookup into the contact list where there are 2 Andrew Smith's and this causes a failure.
I've tried with the following and all failed

                xrmBrowser.Entity.SelectLookup("customerid", "Tester"); //attempt 1
                xrmBrowser.Entity.SetValue(new Lookup { Name = "customerid", Value = "Tester" }); //attempt 2
                xrmBrowser.Entity.SelectLookup("customerid", 0); //attempt 3

I feel that the lookup functions implementation should allow you to enter in a value and then click the search icon rather than the current implementations where the Lookup field search icon is clicked after finding the lookup element and then checks the lookup results.

I've also tried entering the value into the field and then trying the selectloopup function but with no success

                xrmBrowser.Entity.SetValue("customerid", "TEST");
                xrmBrowser.Entity.SelectLookup("customerid", 0);

System.ArgumentException occurred
HResult=0x80070057
Message=An item with the same key has already been added.
Source=mscorlib
StackTrace:
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary2.Insert(TKey key, TValue value, Boolean add) at System.Collections.Generic.Dictionary2.Add(TKey key, TValue value)
at Microsoft.Dynamics365.UIAutomation.Api.XrmEntityPage.OpenDialog(IWebElement dialog) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmEntityPage.cs:line 358
at Microsoft.Dynamics365.UIAutomation.Api.XrmEntityPage.<>c__DisplayClass12_0.b__0(IWebDriver driver) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmEntityPage.cs:line 290
at Microsoft.Dynamics365.UIAutomation.Browser.DelegateBrowserCommand1.ExecuteCommand(IWebDriver driver, Object[] params) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Browser\DelegateBrowserCommand.cs:line 28 at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand1.Execute[T1,T2,T3,T4,T5,T6,T7,T8,T9](IWebDriver driver, T1 p1, T2 p2, T3 p3, T4 p4, T5 p5, T6 p6, T7 p7, T8 p8, T9 p9) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 192
at Microsoft.Dynamics365.UIAutomation.Browser.BrowserCommand1.Execute(IWebDriver driver) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Browser\BrowserCommand.cs:line 36 at Microsoft.Dynamics365.UIAutomation.Browser.BrowserPage.Execute[TResult](BrowserCommandOptions options, Func2 delegate) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Browser\BrowserPage.cs:line 182
at Microsoft.Dynamics365.UIAutomation.Api.XrmEntityPage.SelectLookup(String field, String value) in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Api\Pages\XrmEntityPage.cs:line 275
at Microsoft.Dynamics365.UIAutomation.Sample.CreateProgramEnrolmentValidation.TestCreateProgramEnrolmentValidation() in C:\AutomationTesting\EasyRepro-master\dynamicscrm\Microsoft.Dynamics365.UIAutomation.Sample\CreateProgramEnrolmentValidation.cs:line 35

@dtu11
Copy link
Member

dtu11 commented Dec 4, 2017

This issue should be fixed in the latest release. Please download the latest changes and test again. Let us know if you have any issues.

Thanks

@dtu11 dtu11 closed this as completed Dec 4, 2017
dtu11 added a commit that referenced this issue Dec 21, 2017
Issue #49
Issue #50
Issue #58
Issue #57
Issue #55
Issue #48
Issue #46
Issue #40
dtu11 added a commit that referenced this issue Dec 21, 2017
Issue #49
Issue #50
Issue #58
Issue #57
Issue #55
Issue #48
Issue #46
Issue #40
dtu11 added a commit that referenced this issue Dec 21, 2017
Issue #49
Issue #50
Issue #58
Issue #57
Issue #55
Issue #48
Issue #46
Issue #40
@dtu11 dtu11 mentioned this issue Dec 21, 2017
dtu11 added a commit that referenced this issue Dec 21, 2017
Issue #49
Issue #50
Issue #58
Issue #57
Issue #55
Issue #48
Issue #46
Issue #40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants