Open dfo-elca opened 4 years ago
It will wait 3 secs after finish after typing. Wait again until the Items show once with the text that you look for. Did you work with the latest version?
Hi, thanks for the reply. It's the last version. The issue is that it displays "loading..." indefinitely, so waiting 3 secs doesn't fix it. The only way to clear this "loading..." message is, by hand in the browser, erasing part of the value and typing it again.
Hi,
I mention it because you say that Selenium is typing too fast.
I was able to reproduce it, in the Test UCITestCreateCase, same as your I guest, I wonder about that because I fix this test last week. However for other Lookup Tests it is working fine. I need to stop for the moment, if you find more information about it will help me to fix it later.
Thanks for the Feedback br.
Thanks.
I confirm it's in the test UCITestCreateCase.
I let you know if I find a fix. I had this selenium speed idea because it can be reproduced also in CRM without using EasyRepro. Just copy/past a name in the LookUp field and it will do the same, but if you type it by hand, at a human pace, it works.
This Error just happen if the value is a Contact, for Accounts works fine. :-(
After the one retry attempt the value is set successfully for contacts.
[TestMethod]
public void UCITestCreateCase_EnterCustomerId_Contact_Slowly()
{
var client = new WebClient(TestSettings.Options);
using (var xrmApp = new XrmApp(client))
{
xrmApp.OnlineLogin.Login(_xrmUri, _username, _password, _mfaSecrectKey);
xrmApp.Navigation.OpenApp(UCIAppName.CustomerService);
xrmApp.Navigation.OpenSubArea("Service", "Cases");
xrmApp.CommandBar.ClickCommand("New Case");
xrmApp.ThinkTime(500);
xrmApp.Entity.SetValue("title", "Test Case " + TestSettings.GetRandomString(5, 10));
var value = "Yew Soon";
var customer = new LookupItem { Name = "customerid", Value = value };
string customerName = null;
int i = 1;
do
{
try
{
xrmApp.Entity.SetValue(customer);
xrmApp.ThinkTime(500);
customerName = xrmApp.Entity.GetValue(customer);
}
catch (Exception e)
{
Console.WriteLine($"Attempts {i}/10. Fail: {e}");
}
i++;
} while (customerName != value && i <= 10);
Assert.IsNotNull(customerName);
Assert.IsTrue(customerName.Contains(value));
Console.WriteLine($"Test Pass Successfully after {i-1} attempts.");
}
}
I suggest for this case to repair the build-in retry mechanism, this is not working at the moment. That will fix this Issue, I will open a Bug with this in intention.
Note: Simulate typing slowly or retyping the last char do not help, Run the follow code to try it yourself.
I suggest for this case to repair the build-in retry mechanism, this is not working at the moment. That will fix this Issue, I will open a Bug with this in intention.
Thanks!
I was able to workaround this by doing a clearvalue prior to the setvalue:
// To work around the bug below, clearvalue first to initalize the field and then set it
xrmApp.Entity.ClearValue(new LookupItem { Name = "customerid"});
// Bug - System.InvalidOperationException: No Results Matching maria campbell Were Found. #769
xrmApp.Entity.SetValue(new LookupItem { Name = "customerid", Value = "maria campbell", Index = 0 });
I was able to workaround this by doing a clearvalue prior to the setvalue:
// To work around the bug below, clearvalue first to initalize the field and then set it xrmApp.Entity.ClearValue(new LookupItem { Name = "customerid"}); // Bug - System.InvalidOperationException: No Results Matching maria campbell Were Found. #769 xrmApp.Entity.SetValue(new LookupItem { Name = "customerid", Value = "maria campbell", Index = 0 });
This is not working for me in Quick create form
Any fixes for this issue ? I was facing this issue only for selected values in lookup option
Hi,
Also facing this issue, running in Visual Studio 2019. Similar to others, the lookup appears but it just isn't selected. An exception is generated:
Managed Debugging Assistant 'ContextSwitchDeadlock' Message=Managed Debugging Assistant 'ContextSwitchDeadlock' : 'The CLR has been unable to transition from COM context 0x6e19a8 to COM context 0x6e1a60 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.'
Code being run was:
xrmApp.Entity.ClearValue(new LookupItem { Name = "customerid" }); xrmApp.Entity.SetValue(new LookupItem { Name = "customerid", Value = "Jas Limited", Index = 0 });
EasyRepro Version
UCI or Classic Web
Online or On Premise
Browser
While running the default CreateCaseUCI, at the step of setting the customerid, the browser stays at "Loading..." until it times out, instead of displaying the record. If I manually delete the last char and write it again, it finds the record and the test scenario ends correctly. I suspect it's related to the value being typed too fast by selenium.
Here is what it looks like:
Code:
LookupItem customer = new LookupItem { Name = "customerid", Value = "aaron aina", Index = 0}; xrmApp.Entity.SetValue(customer);