-
Notifications
You must be signed in to change notification settings - Fork 66
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
SelectElement: various getText()-methods are not implemented properly #5646
Comments
@rolfsmeds @yuriy-fix the API described above is a part of |
I managed to reproduce the issue with the provided project (slightly modified so it uses bonigarcia WebDriverManager to setup the WebDriver), but only when testing using Firefox. When running the test using Chrome or Safari the texts retrieval from Selects works as expected. I've used the following version of the driver:
Reproduced with Vaadin 23.3.26 |
I've tested the issue, and all the various ways to get the text of the selected item are actually relying on calling This Selenium API method does not work correctly when using FirefoxDriver where it always returns an empty string if the element is a custom webcomponent. I mean any webcomponent... not only Vaadin webcomponents. So this is not a Vaadin-specific issue. And the problem is unfortunately not in TestBench, but in Selenium itself. However, that means that this problem does not affect only SelectElement but all the Vaadin TestBench Element classes. The issue has already been reported to various places, and it seems that it's being actively worked on in recent hours: An issue was reported against webdriverio: I think it makes sense to wait now for fix of the mentioned bugs before trying to do any workarounds in the TestBench code. The immediate workaround which I can advice now is not to use Firefox for TestBench testing until the issue is resolved ,and switch for example to ChromeDriver, where this issue does not exist. |
I've put together simple project where it's demonstrated that the Firefox Selenium driver does not work correctly and returns empty strings when calling WebElement.getText() for webcomponents. Use this project to test if the issue was fixed already or not: https://github.com/bwajtr/selenium-firefox-gettext-webcomponents |
Current state:
If the mentioned bug is not fixed for a long time, then we will have to introduce some workarounds in TestBench how to |
The problem has been fixed in Firefox and the fix will be available in Firefox 122. I have tested with the nightly build of Firefox 122 and the issue is no longer reproducible with it. Current status of this issue:
|
NotificationElement#getText is also not not working with Firefox, you can run IT's here to see https://github.com/TatuLund/ColorPicker/blob/master/src/test/java/org/vaadin/addons/tatu/FirefoxColorPickerIT.java the same tests work ok for Chrome. |
I tested this with the project provided by @bwajtr and also tested Closing as no longer reproducible. |
Hello, we're using Vaadin 23 and doing selenium-tests quite a lot. We recently found, that extracting a simple text from a simple Select-item is quite cumbersome with provided SelectElement. I have build a small test case (maven project, attached) demonstrating the issue:
Production view:
Selenium test:
Output:
Basically various getText methods are not working as one would intuitively expect them to and we have to resort to dubios workaround getPropertyString("textContent"), which may depend on the implementation and thus Vaadin version i'm afraid.
The text was updated successfully, but these errors were encountered: