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
[BUG] GetValue not working #765
Comments
Hi @imartinflores, Thanks for your feedback. for a lookup value you should use the follow overload of GetValue
Can you check please that your bug is not the same that #756? PR #764 should fix it. br |
I work with @imartinflores and we are already doing the way you offer. Like we said, our assumption so far is that something change on UI with the MS update because we didn't change anything on our code and it was working fine before. |
Hi @Haywaii, Yes, it doesn't works, because this the PR is not merged yet to 'develop' & released. But is the same Issue as #756? To be sure you can run your code as I show in this comment. That will call the "new" logic. After this PR get approved you will be able to work as usual, with ´GetValue(LookupItem)´ instead the ´GetValue(LookupItem[])´ which now is working fine in 'develop' branch. Thanks & br |
Hi @AngelRodriguez8008 , thanks for the answer. Yes, that's ok, do you know when this will get merged ? Entity_LookupFieldExistingValue: //*[@data-id='[NAME].fieldControl-LookupResultsDropdown_[NAME]_selected_tag'] Seems like not all of the LookupItems have the same xpath, you are using it on the TryGetValue. Thank you. |
From the implementation GetValue(LookupItem[]) I deduce that you get in HTML an when the field do not contains any value. I such case GetValue return am empty string. Is it your case? |
Yes, before was returning "---" as it is the value that the field has. Now, even if it has "---" it returns empty, we can change that on our tests, but need to confirm we will always return empty in this case. |
Try this: using Microsoft.Dynamics365.UIAutomation.Browser;
// in Tests
Assert.IsTrue(lookupValue.IsEmptyValue()); You should have already in your API: Microsoft.Dynamics365.UIAutomation.Browser.StringExtensions: 65-66:
public static bool IsEmptyValue(this string fieldValue)
=> string.IsNullOrWhiteSpace(fieldValue?.Trim('-')); // null, Empty or "---" You will never need to change your tests again :-) Note: or you can implement your own IsEmptyLookupValue & you will be able to change it just in one place. |
Hi @imartinflores, The PR is merged can we close this Issue? Thanks & br |
Yes, very nice ! Thank you! |
Sorry. I mean: |
@AngelRodriguez8008 have you updated the nuget package ? |
Sorry. I'm not able to do it. Probably the MS guys did it. |
No worries, thanks for helping! |
Bug Report
xrmApp.Entity.GetValue command not working.
EasyRepro Version
UCI or Classic Web
Online or On Premise
Browser
Describe the bug
Hi guys, seems like the GetValue command is not working. I have checked EasyRepro repo and it seems to be trying to find "input" or "textarea" tagname when using the GetValue command.
if (fieldContainer.FindElements(By.TagName("input")).Count > 0)
{
var input = fieldContainer.FindElement(By.TagName("input"));
if (input != null)
{
IWebElement fieldValue = input.FindElement(By.XPath(AppElements.Xpath[AppReference.Entity.TextFieldValue].Replace("[NAME]", field)));
text = fieldValue.GetAttribute("value").ToString();
Some of the LookupItems are now
so it is throwing "Field element {name} does not exist. This was working fine on Friday. We picked the issue yesterday, and we know that there was a Microsoft update during the weekend.
Code to reproduce
xrmApp.Entity.GetValue(new LookupItem { Name = "name"});
Expected behavior
LookupItem value should be found
Screenshots
If you can look into this ASAP should be great. Thanks
The text was updated successfully, but these errors were encountered: