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

Dropdown: The class value "dropdown-wrapper " has an extra blank space in the end #8894

Open
InforBG opened this issue Jul 11, 2024 · 5 comments
Labels
team: sunsystems Issues for the Sunsystems (teams) type: bug 🐛 [1] Velocity rating (Fibonacci)

Comments

@InforBG
Copy link

InforBG commented Jul 11, 2024

Describe the bug
In IDS 4.95.x, the class value "dropdown-wrapper " has an extra blank space in the end. IDS 4.93.0 doesn't have this problem.
We are using XPATH to locate the web element for Automation tests. For example, the XPATH is "./following-sibling::div [./@class='dropdown-wrapper']/div[not(contains(./@style, 'display: none;'))][1]".
In IDS 4.95.x or 4.96.0, the XPATH becomes invalid.
Is it a design change or bug to have the extra blank space in the end?

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://latest-enterprise.demo.design.infor.com/components/dropdown/example-clearable?theme=uplift&variant=light&layout=embedded
  2. Look at the HTML elements
  3. See the class value as the screenshot below

Expected behavior
The class value don't have the useless space in the end. It should be just "dropdown-wrapper".

Version

  • ids-enterprise: [e.g. v4.95.0 or v4.96.0]

Screenshots
image

Platform

  • Infor Application/Team Name: [Infor SunSystems]
  • OS Version: [Windows 11]
  • Browser Name: [chrome]
  • Browser Version: [126.0.6478.127 (Official Build) (64-bit)]
@tmcconechy tmcconechy changed the title The class value "dropdown-wrapper " has an extra blank space in the end Dropdown: The class value "dropdown-wrapper " has an extra blank space in the end Jul 11, 2024
@tmcconechy tmcconechy added type: bug 🐛 [2] Velocity rating (Fibonacci) labels Jul 11, 2024
@tmcconechy
Copy link
Member

@InforBG we can get rid of the space. But that being said i never recommend xpath

@InforBG
Copy link
Author

InforBG commented Jul 12, 2024

Thanks, @tmcconechy .
We are using Selenium for the automation tests.
Which technology will you recommend to locate the element?
For example, to use the xpath "./following-sibling::div [./@class='dropdown-wrapper']/div[not(contains(./@style, 'display: none;'))][1]",

  1. we get the 'select' element by ID;
  2. get the next sibling which has the class value 'dropdown-wrapper'; then get the visible child element.

If we don't use the xpath, what will you recommend? Thanks for any advices.

@tmcconechy
Copy link
Member

tmcconechy commented Jul 12, 2024

@InforBG we will update this for you as the space isnt needed but i usually suggest css selectors in whatever test tool im using. (i also like it since its similar to JS development in general)

Maybe https://www.browserstack.com/guide/css-selectors-in-selenium#:~:text=CSS%20(Cascading%20Style%20Sheets)%20Selectors,faster%20as%20compared%20to%20XPath.

So then select by class instead and it could ignore the space?

@InforBG
Copy link
Author

InforBG commented Jul 16, 2024

Thanks for update this.

The CSS locator in Selenium seems to have limitations. It is better than the other locators when locate web elements based on their id, class, name, attributes.
While the XPath locator can handle more complicated scenarios. For example, we have one known element. Use xpath to get the next sibling's first visible child. Or get a grid's parent element and some elements within it. CSS couldn't do it easily in my understanding.

https://www.browserstack.com/guide/xpath-in-selenium

While other [locators in Selenium](https://www.browserstack.com/guide/locators-in-selenium) that search for elements using tags or CSS class names are more straightforward, they may not be sufficient to select all DOM elements of an HTML document.
XPath provides an option to search for an element within a web page dynamically, thus giving sufficient flexibility to tweak a locator to one’s advantage.

@AAlviar AAlviar added [1] Velocity rating (Fibonacci) team: sunsystems Issues for the Sunsystems (teams) and removed [2] Velocity rating (Fibonacci) labels Jul 16, 2024
@tmcconechy
Copy link
Member

OK @InforBG i dont use selenium directly we use Playwright so cant 100% help but i know that xPaths have in the past caused issues. Will get a fix for the extra space

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: sunsystems Issues for the Sunsystems (teams) type: bug 🐛 [1] Velocity rating (Fibonacci)
Projects
Status: Groomed
Development

No branches or pull requests

3 participants