Closed ddNils closed 2 years ago
Hi, could you please provide more context info? Ideally, a working minimum viable sample reproducing the error would help tremendously.
wdi5/wdio-ui5-service
-version: [e.g. 0.8.1]UI5
version: [e.g. 1.98.0]wdio
-version (output of wdio --version
): [e.g. 7.16.12]node
-version (output of node --version
): [e.g. v17.3.0]To Reproduce Steps to reproduce the behavior:
That being said, the diff v0.9.0...v0.9.1
was a single add of a feature, namely the Fiori Elements v4 Test library support. Nothing was changed in terms of Control retrieval or the way native UI5 api methods are executed on a retrieved control.
Any chance your app has changed in the meantime?
wdi5/wdio-ui5-service-version: 0.9.1 (0.9.0 is still working as expected) UI5 version: name: OpenUI5 version: "1.92.0" wdio-version (output of wdio --version): 7.19.7 node-version (output of node --version): v17.3.1 OS: Windows 10 Browser + Version: chrome 102 (101 last week)
We have changed the test and included dotenv to read env variables from files. But the problem is still reproduceable. Each time we try to change to 0.9.1 we get the above error.
Here is some more from the stack:
[0-0] RUNNING in chrome - C:\Code\TestProjects\e2e-tests\test\specs\start-crm.e2e.ts
DevTools listening on ws://127.0.0.1:57880/devtools/browser/e7739682-3e17-4756-bff6-87748351aed7
2022-06-13T13:08:18.454Z WARN chromedriver: [1655125698.453][WARNING]: This version of ChromeDriver has not been tested with Chrome version 102.
[0-0] [wdi5] skipped wdi5 injection!
[0-0] 2022-06-13T13:08:30.545Z WARN webdriver: Request failed with status 500 due to javascript error: failed to load 'sap/fe/test/ListReport.js' from https://openui5.hana.ondemand.com/resources/sap/fe/test/ListReport.js: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://openui5.hana.ondemand.com/resources/sap/fe/test/ListReport.js'.
[0-0] JavaScript stack:
[0-0] ModuleError: failed to load 'sap/fe/test/ListReport.js' from https://openui5.hana.ondemand.com/resources/sap/fe/test/ListReport.js: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://openui5.hana.ondemand.com/resources/sap/fe/test/ListReport.js'.
[0-0] at p1 (https://openui5.hana.ondemand.com/resources/sap-ui-core.js:53:213)
[0-0] at j1.failWith (https://openui5.hana.ondemand.com/resources/sap-ui-core.js:40:43)
[0-0] at x1 (https://openui5.hana.ondemand.com/resources/sap-ui-core.js:62:2390)
[0-0] at z1 (https://openui5.hana.ondemand.com/resources/sap-ui-core.js:64:474)
[0-0] at Object.l [as require] (https://openui5.hana.ondemand.com/resources/sap-ui-core.js:69:544)
[0-0] at eval (eval at executeAsyncScript (:552:26), <anonymous>:66:20)
[0-0] at eval (eval at executeAsyncScript (:552:26), <anonymous>:377:8)
[0-0] at eval (eval at executeAsyncScript (:552:26), <anonymous>:378:4)
[0-0] at executeAsyncScript (<anonymous>:552:47)
[0-0] at <anonymous>:567:29
[0-0] Caused by: Error: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://openui5.hana.ondemand.com/resources/sap/fe/test/ListReport.js'.
[0-0] at XMLHttpRequest.send (https://openui5.hana.ondemand.com/resources/sap/ui/test/autowaiter/_XHRWaiter.js?eval:6:1001)
[0-0] at u1 (https://openui5.hana.ondemand.com/resources/sap-ui-core.js:58:408)
[0-0] at x1 (https://openui5.hana.ondemand.com/resources/sap-ui-core.js:62:2361)
[0-0] at z1 (https://openui5.hana.ondemand.com/resources/sap-ui-core.js:64:474)
[0-0] at Object.l [as require] (https://openui5.hana.ondemand.com/resources/sap-ui-core.js:69:544)
[0-0] at eval (eval at executeAsyncScript (:552:26), <anonymous>:66:20)
[0-0] at eval (eval at executeAsyncScript (:552:26), <anonymous>:377:8)
[0-0] at eval (eval at executeAsyncScript (:552:26), <anonymous>:378:4)
[0-0] at executeAsyncScript (<anonymous>:552:47)
[0-0] at <anonymous>:567:29
[0-0] (Session info: chrome=102.0.5005.63)
[0-0] [wdi5] Navigating to: "#"
[0-0] 2022-06-13T13:08:30.650Z WARN webdriver: Request failed with status 500 due to javascript error: Cannot read properties of undefined (reading 'bind')
[0-0] JavaScript stack:
[0-0] TypeError: Cannot read properties of undefined (reading 'bind')
[0-0] at eval (eval at executeAsyncScript (:552:26), <anonymous>:31:39)
[0-0] at eval (eval at executeAsyncScript (:552:26), <anonymous>:33:8)
[0-0] at eval (eval at executeAsyncScript (:552:26), <anonymous>:33:33)
[0-0] at executeAsyncScript (<anonymous>:552:47)
[0-0] at apply.selector.id (<anonymous>:567:29)
[0-0] at callFunction (<anonymous>:446:22)
[0-0] at <anonymous>:460:23
[0-0] at <anonymous>:461:3
[0-0] (Session info: chrome=102.0.5005.63)
this also seems to be related to #275
with 0.9.1
, we additionally allowed complex objects to be returned from the browser scope. And might have messed up properties of the original UI5 object along the way ðŸ˜ðŸ¤•
but we‘re on it, specifically on #275
with #280 in and v0.9.3
being available, could you please re-check and see whether your issue was resolved?
thanks!
I tried several times by now. Could not get it working, it still fails with:
javascript error: javascript error: Cannot read properties of undefined (reading 'bind')
JavaScript stack:
TypeError: Cannot read properties of undefined (reading 'bind')
at eval (eval at executeAsyncScript (:552:26), <anonymous>:31:39)
at eval (eval at executeAsyncScript (:552:26), <anonymous>:33:8)
at eval (eval at executeAsyncScript (:552:26), <anonymous>:33:33)
at executeAsyncScript (<anonymous>:552:47)
at apply.selector.id (<anonymous>:567:29)
at callFunction (<anonymous>:446:22)
at <anonymous>:460:23
at <anonymous>:461:3
(Session info: chrome=102.0.5005.115)
at getErrorFromResponseBody (\e2e-tests\node_modules\webdriver\build\utils.js:197:12)
at NodeJSRequest._request (\e2e-tests\node_modules\webdriver\build\request\index.js:166:60)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Browser.wrapCommandFn (\e2e-tests\node_modules\@wdio\utils\build\shim.js:137:29)
at async Browser.wrapCommandFn (\e2e-tests\node_modules\@wdio\utils\build\shim.js:137:29)
at async clientSide_getControl (\e2e-tests\node_modules\wdio-ui5-service\client-side-js\getControl.js:3:12)
hmmm...sorry for suspecting and asking this, but: have you explicitly done rm -rf node_modules
(or equivalent) and updated to wdio-ui5-service
to 0.9.3
? I'm only asking because #277 had a similar issue to yours and that was resolved with 0.9.3
I did another test with completely removing it - and it still does not work
after taking another look at your provided logs, this caught my eye:
[0-0] ModuleError: failed to load 'sap/fe/test/ListReport.js' from https://openui5.hana.ondemand.com/resources/sap/fe/test/ListReport.js: Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'https://openui5.hana.ondemand.com/resources/sap/fe/test/ListReport.js'.
→ the namespace sap.fe
doesn't seem to be available in OpenUI5! yet we're using it for the integration of the OData v4 test library.
so a possible solutions is to switch to SAPUI5 for bootstrapping from CDN (https://sapui5.hana.ondemand.com/resources/sap/fe/test/ListReport.js works!)
@nlunets / @Siolto / @georgbischoff: I'll add an issue on fine-tuning OData v4 test library detection at wdi5
start time!
Hey @Siolto and @vobu - 0.9.4 did the trick! - it's working again!
Thank you for the fast response :)
We are getting a lot of undefined errors like this one:
This only happened when we changed to version 0.9.1 - with 0.9.0 its working without issues again.
We also use delayed wdi5 injection through
ui5service.injectUI5()
(I assume the error stems from here).