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

Fix #756 GetValue From Lookup don't work properly #764

Merged

Conversation

AngelRodriguez8008
Copy link
Contributor

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Other (updates to documentation, formatting, etc.)

Description

Fix #756 GetValue From Lookup don't work properly
At least in the cases that I check for 5 different lookup controls.
Account -> Owner (on header)
Account -> Primary Contact
Account -> Currency
Contact -> Account
Contact -> Company
The new XPath to the text value in UCI look like:
//div[data-id="[NAME].fieldControl-LookupResultsDropdown_[NAME]_selected_tag_text"]

I found that the implementation of GetValue(LookupItem[]) from PR #515 use a similar XPath.
{ "Entity_LookupFieldExistingValue", "//*[@data-id='[NAME].fieldControl-LookupResultsDropdown_[NAME]_selected_tag']" }

The implementation of #515 was refactored in previos PRs, but still having the same logic, described as follow:
There is two different implementations for GetValue From Lookups:

  1. for one value GetValue(LookupItem)
  2. for "activity party fields", lookups that allows more than one value GetValue(LookupItem[])
    It's look like 2 works fine for also 1. But the current implementation of 1. is no longer working (Issue on GetValue From Lookup  #756)

Fixed on the on the top of the previous PR #754 one commit, 2 files.

This PR Unify the Logic of GetValue with LookupItem & LookupItem[]
The new Implementation, use in both cases the same logic but:
GetValue(LookupItem)
returns for a Single Value Lookup an String Value or an Empty String (as before)
but also returns a "; " separated values for a Multi-Values-Lookup

GetValue(LookupItem[])
returns for a Single Value Lookup an String[] with just one Value or an Empty String[]
returns for a Multi-Values-Lookup an String[] (as before)

Optional: this logic can also be adapted to return "null" instead empties string & string[].

Issues addressed

Fix #754

All submissions:

  • My code follows the code style of this project.
  • Do existing samples that are effected by this change still run?
  • I have added samples for new functionality.
  • I raise detailed error messages when possible.
  • My code does not rely on labels that have the option to be hidden.

Which browsers was this tested on?

  • Chrome
  • Firefox
  • IE
  • Edge

Copy link
Contributor Author

@AngelRodriguez8008 AngelRodriguez8008 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to Fix Alls samples Tests: Fix Some Bugs, take advantage of the new Logic in Selenium Extensions methods. Refactor some methods & remove some duplicated code. Fix some Navigation Issues.

@TYLEROL TYLEROL added the bug label Feb 18, 2020
@TYLEROL TYLEROL added this to the 9.1.0.12013 milestone Feb 18, 2020
@TYLEROL TYLEROL merged commit 535245d into microsoft:develop Feb 18, 2020
@thathi
Copy link
Contributor

thathi commented Feb 19, 2020

@AngelRodriguez8008

                string[] lookupValues = existingValues.Select(v => v.GetAttribute("innerText").ToLowerString()).ToArray(); //IE can return line breaks

Convert tolower is it intentional in private string[] TryGetValue(IWebElement fieldContainer, LookupItem[] controls) method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue on GetValue From Lookup
3 participants