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

Endless waiting of XHR requests (Auto Waiter?) #569

Closed
mehmet-sap opened this issue Dec 21, 2023 · 7 comments
Closed

Endless waiting of XHR requests (Auto Waiter?) #569

mehmet-sap opened this issue Dec 21, 2023 · 7 comments
Assignees

Comments

@mehmet-sap
Copy link

Describe the bug
WDI5 is indirectly testing a UI5 app that is continuesly sending XHR requests for updating a current status. This behavior is causing WDI5 to wait forever until the requests are resolved. In our case this will not be resolved so we cannot continue with testing an app. The test is running into a timeout.

Our workaround is to directly accessing the element via the id of for example a button.

To Reproduce
Please contact me and I will show you that behavior in our application in a meeting.

Expected behavior
I expect to access all elements in the app via wdi5 selector. Currently no elements could be accessed only if we use the following accessor: $().

Logs/Console Output
[0-0] [wdi5] call of _getControl() failed because of: Error: Polling stopped because the timeout of 60000 milliseconds has been reached but there is still pending asynchronous work.
[0-0] This is the last log of pending work:
[0-0] There are 1 open XHRs and 0 open FakeXHRs.
[0-0] XHR: URL: '/sap/opu/odata/sap/APS_EXT_ATO_IMP_SRV/$batch?sap-client=200' Method: 'POST' Async: 'true'
[0-0] Stack: at Object.e [as resolveStackTrace] (/resources/sap/ui/test/autowaiter/_utils.js?eval:6:117)
[0-0] at XMLHttpRequest.d (/resources/sap/ui/test/autowaiter/_XHRWaiter.js?eval:6:1318)
[0-0] at XMLHttpRequest.send (/resources/sap/ui/test/autowaiter/_XHRWaiter.js?eval:6:971)
[0-0] at Object.request (/resources/sap/ushell_abap/bootstrap/evo/abap.js:482:20511)
[0-0] at Sr (/resources/sap/ushell_abap/bootstrap/evo/abap.js:482:12217)
[0-0] at n.request (/resources/sap/ushell_abap/bootstrap/evo/abap.js:482:65316)
[0-0] at z._request (/resources/sap/ushell_abap/bootstrap/evo/core-ext-light-2.js:271:71732)
[0-0] at g (/resources/sap/ushell_abap/bootstrap/evo/core-ext-light-2.js:271:30467)
[0-0] at /resources/sap/ushell_abap/bootstrap/evo/core-ext-light-2.js:271:29893
[0-0] at e (/resources/sap/ui/test/autowaiter/_promiseWaiter.js?eval:6:2396) - sap.ui.test.autowaiter._XHRWaiter#hasPending

Runtime Env (please complete the following information):

  • wdi5/wdio-ui5-service-version: 1.5.6
  • UI5 version: 1.121.0
  • wdio-version (output of wdio --version): 7.27.0
  • node-version (output of node --version): v18.17.1
  • OS: Windows 11
  • Browser + Version: Chrome Version 120.0.6099.71

Additional context
It would be very helpful to have an option to deactivate the auto wait feature.

@dominikfeininger
Copy link
Collaborator

All the waiting for the UI5 application is done inside the RecordReplay API.

Can @hmanchev provide some insides?

@Siolto
Copy link
Collaborator

Siolto commented Dec 21, 2023

We could probably add an optional autoWait property to the selector which is per default true. That would be the same as in OPA5. Something like that:

browser.asControl({
  autoWait: false, // optional property - default: true
  selector: {
    // wdi5 selector...
  }
})

Further analysis what needs to be changed has to be done.

@hmanchev
Copy link
Collaborator

hmanchev commented Jan 3, 2024

Siolto's idea seems reasonable for me.

@Siolto Siolto self-assigned this Jan 8, 2024
@Siolto
Copy link
Collaborator

Siolto commented Jan 9, 2024

After further analyzing this issue we came to the conclusion that we don't want to add the possibility to disable the autoWait. There are just to many side effects and it would produce very fragile tests as a result.

Instead we came up with the idea to give the possibility to exclude/ignore certain calls from the autoWaiter. This is already happening with specific OPA5 calls here.

@hmanchev would it be possible for your team to add a feature to the autoWaiter, that we could pass the information which calls should be excluded/ignored?

@hmanchev
Copy link
Collaborator

hmanchev commented Jan 9, 2024

I would like to invite @jdichev in this discussion as he can comment from OPA side.

@Siolto
Copy link
Collaborator

Siolto commented Jan 11, 2024

@hmanchev @jdichev @mehmet-sap,

we drafted a first potential PR for that in wdi5. We see our approach currently only as a workaround till you could add this feature directly to the autowaiter and we could pass the information via the options object.

@vobu
Copy link
Contributor

vobu commented Jan 15, 2024

hopefully resolved with wdi5 2.0.6

@vobu vobu closed this as completed Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants