-
Notifications
You must be signed in to change notification settings - Fork 22
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
waitForVaadin() fails when switching between multiple UIs #869
Comments
Hi, Do you happen to have some kind of test to share, where you encounter this problem? Does it happen when you navigate by clicking a link, opening a new URL or some other means? When opening a page using the When the |
Hi! Thanks so much for the speedy response. As to "when does it happen", I should have mentioned this is an intermittent failure. We have around 300 tests running on CI and every other build we are hit with either situation 2 or 4 above in one of our tests. (Which one seems to be random). This happens when opening a new URL like so:
and also after clicking links/buttons. Should we use About a test I can share with you, I've shared this thread with our development lead and we'll see what we can do. I'll get back to you on that. |
I tried running a test which navigates between UIs by either clicking on a link or by using |
Vaadin support suggested that we file following issue as a bug.
We use selenium and phantomjs (v2.1.1) alongside testbench.
After navigating to a page, we call waitForVaadin() via the WebDriver in order to wait for Vaadin initialization to complete.
After this, we attempt to find an element like so:
$(TextFieldElement.class).first();
but receive this error:
Vaadin could not find elements with the selector (//com.vaadin.ui.TextField)[0]
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Caused by: org.openqa.selenium.WebDriverException:
{"errorMessage":"undefined is not a function (evaluating 'clients[client].getElementsByPath(arguments[0])')" ...}
We receive this error after navigating between UIs.
After close inspection of the "undefined is not a function" error message and TestBenchCommandExecutor.waitForVaadin() method we constructed the following experimental wait method:
We find that calling this function will properly wait for Vaadin to initialise. We accumulated error codes from cases where the javascript code was retried, and found that it failed with error codes 4, and 2, corresponding to
window.vaadin == null
andclient.getElementsByPath == undefined
respectively.We noticed that TestBenchCommandExecuter.waitForVaadin() does not check for case 2, and will exit early without retrying if it encounters case 4. Whereas the above workaround fixes the issue for us by retrying on these cases.
Thanks in advance!
The text was updated successfully, but these errors were encountered: