wdi5: browser.asControl({timeout ... has no effect
Describe the bug
For a slow responding systems where the page takes too much time to respond, the timeout feature of the browser.asControl has no affect.
To Reproduce Not possible to reproduce on every system.
Expected behavior The timeout parameter should respect the wait for the element to load.
Logs/Console Output
Code
await browser.asControl({
selector: {
controlType: 'sap.ushell.ui.launchpad.AnchorItem',
properties: { "title":"Administrator" }
},
timeout: 90000,
forceSelect: true
})
Output

Screenshots if applicable, add screenshots to help explain your problem.
Runtime Env (please complete the following information):
wdi5/wdio-ui5-service-version: 1.0.3UI5version: 1.106.1wdio-version (output ofwdio --version): 7.195node-version (output ofnode --version): 18.12.1- OS: MacOS
- Browser + Version 1.108
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 22 (7 by maintainers)
After discussion we planned to enhance the auto-waiter with support for fetch and sync xmlHttpRequest. Thanks again @Siolto for taking the time to compose the clear samples. We will update when the new implementation is available.
Hi colleagues,
OPA experts are notified about this potential bug and we are waiting for their feedback. Please stay tuned.
BR, Hristo
Hi @nair-sumesh,
Just as a side note, I see you are using UI5 version 1.106.1 which does not contain a recent enhancement to the auto-waiter https://github.com/SAP/openui5/commit/6b478630a249a8311ab1e77fe29efb7111ac55da that enables it to track ongoing animations. It was included in 1.107 and all later UI5 versions. Given that 1.106 is no longer listed as supported (I’m checking against the list at https://sapui5.hana.ondemand.com/versionoverview.html) you could (if you want) from now update to 1.108 or any later supported version while we are working on the remaining discussed enhancements (tracking of fetch and XMLHttpRequest without async set to true)
Hi @Siolto,
Thank you the samples that clearly show cases not covered by the auto-waiter. I’ll request internally to plan a research why these were not covered so far and discuss their inclusion.
I posted my earlier question because these two cases (fetch and sync xmlHttpRequest) are examples where the auto-waiter does not wait at all (because it does not even detect them), while the original issue was supposedly about the auto-waiter waiting too long (because @nair-sumesh mentioned the auto-waiter did not respect the custom timeout)
This is why I wanted @nair-sumesh to clarify again the original issue (waiting too long OR not waiting enough time).
Hi @kineticjs
thanks for looking into this issue. Yes in your example everything is working as expected. But as already written above, it is not about the
setTimeoutbut more aboutfetchorxmlHttpRequestrequests which are not correctly covered via thewaitForUI5. Maybe there are even more cases that are not covered by the autoWaiter but these are the two examples I could find.I have a minimal reproducible example for you with a running express server:
npm installnpm run start:ui5andnpm run start:nodein two different terminalssetTimeout<== works -fetch<== does not work -xmlHttpRequest<== only works withasyncspecifically set totrue(example is in the code)For the
xmlHttpRequestI may have found the line where you could start debugging. It seems like there is the bug.For the
fetchI am pretty sure this should be handled via _promiseWaiter.js but there is to much 🪄 going on to give you a concrete guidance here.I hope my example helps you get to the root of this problem.
Regards Simon
After having a hard time debugging this, I may have found the Bug:
It is not our custom
timeouton the selector but the synchronization with the ui5 framework throughsap/ui/test/autowaiter/_autoWaiterAsync. That’s why I want to bring @hmanchev in the loop.It seems like the
sap/ui/test/autowaiter/_autoWaiterAsyncis not feature complete or a little bit flaky with some requests. For example all requests viafetchare not recognized and will not be awaited till they are resolved/rejected.Also the request fired via XMLHttpRequest which are not specifically marked as
asyncwill be also not correctly tracked.Further investigation is needed to really find the root of this problem.