Conversation
| { | ||
| returnElement = wait.Until(d => d.FindElement(by)); | ||
|
|
||
| var foundElements = wait.Until(d => d.FindElements(by)); |
There was a problem hiding this comment.
[UPDATED] There is a problem hier, if you call FindElements if the element is not already loaded, you will get an Empty Collection but not NULL. That's means you will not really "wait", see the implementation of wait.Until:

For me fail at Login Dialog by "Enter Email"
To get the desired Effect you need to do something like that:
Func<IWebDriver, IWebElement> conditions = d =>
{
ReadOnlyCollection<IWebElement> elements = d.FindElements(by);
int? count = elements?.Count;
if (count == null || count == 0)
return null;
var result = count > 1
? elements.FirstOrDefault(x => x?.Displayed == true)
: elements.First(x => x != null);
return result;
};
returnElement = wait.Until(conditions);There was a problem hiding this comment.
Hi AngelRodriguez8008,
Sorry I haven't been checking github and i've moved on from doing automated testing for D365.
Your previous post showed great explanation to the root of the issue. Can you please refactor the codes and apply the fix for it because you can test the login dialog issue. I did have some random UCI login issue few weeks ago but it was inconsistent (1 issue out of 5 runs sort of thing) so I didn't look into it.
If you want me to do it, i'll need to spend sometime setting up D365 classic web app and test the codes. Let me know what you wanna do. Cheers
Type of change
Description
Latest version of EasyRepro introduced a new bug #702 while trying to fix #620 . The new bug is to do with Quick Create form not working for Lookup fields. The fix for this is to sort of undo the changes for the fix of bug #620 .
This pull request also include a fix for bug #684 where the quick create form elements not interactable due to the page having 2 fields with the same data-id (1 from quick create and 1 from the main entity). This issue happened because the codes only look for the first element on the page using a given data-id. It would find the one on the main page for creating/editing this entity record instead of the one from Quick Create. To address this issue, we have to find all elements matching the given data-id and check for the one that is visible on the screen.
Issues addressed
This would fix the issue with Lookup field on Quick Create form and not causing bug #620 to be recreated.
The fix for bug #684 would make the Quick Create form works perfectly for that specific case and any other cases.
All submissions:
Which browsers was this tested on?