wdi5: Tests are failing since SAPUI5 version 1.104

Describe the bug We have raised the version of SAPUI5 in our repository. As of version 1.104, the tests no longer seem to run.

To Reproduce Steps to reproduce the behavior:

  1. Start some WDI5 tests
  2. Change the Version of UI5 to 1.104 or higher (till 1.108)
  3. Start the WDI5 tests again
  4. Get javascript error: Cannot read properties of undefined (reading ‘waitForUI5Options’)

Expected behavior It is expected that the tests will go through normally as before, after the version is raised higher than 1.103.

Logs/Console Output

[chrome 107.0.5304.87 mac os x #0-0] javascript error: Cannot read properties of undefined (reading 'waitForUI5Options')
JavaScript stack:
TypeError: Cannot read properties of undefined (reading 'waitForUI5Options')
    at eval (eval at executeAsyncScript (:552:26), <anonymous>:4:65)
    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.forceSelect (<anonymous>:567:29)
    at callFunction (<anonymous>:446:22)
    at <anonymous>:460:23
    at <anonymous>:461:3
  (Session info: headless chrome=107.0.5304.87)
[chrome 107.0.5304.87 mac os x #0-0] javascript error: javascript error: Cannot read properties of undefined (reading 'waitForUI5Options')
[chrome 107.0.5304.87 mac os x #0-0] JavaScript stack:
[chrome 107.0.5304.87 mac os x #0-0] TypeError: Cannot read properties of undefined (reading 'waitForUI5Options')
[chrome 107.0.5304.87 mac os x #0-0]     at eval (eval at executeAsyncScript (:552:26), <anonymous>:4:65)
[chrome 107.0.5304.87 mac os x #0-0]     at eval (eval at executeAsyncScript (:552:26), <anonymous>:33:8)
[chrome 107.0.5304.87 mac os x #0-0]     at eval (eval at executeAsyncScript (:552:26), <anonymous>:33:33)
[chrome 107.0.5304.87 mac os x #0-0]     at executeAsyncScript (<anonymous>:552:47)
[chrome 107.0.5304.87 mac os x #0-0]     at apply.forceSelect (<anonymous>:567:29)
[chrome 107.0.5304.87 mac os x #0-0]     at callFunction (<anonymous>:446:22)
[chrome 107.0.5304.87 mac os x #0-0]     at <anonymous>:460:23
[chrome 107.0.5304.87 mac os x #0-0]     at <anonymous>:461:3
[chrome 107.0.5304.87 mac os x #0-0]   (Session info: headless chrome=107.0.5304.87)
[chrome 107.0.5304.87 mac os x #0-0]     at async clientSide_getControl (/Users/metehan.dogan/U-NIQ/project-X/node_modules/wdio-ui5-service/client-side-js/getControl.js:3:12)
[chrome 107.0.5304.87 mac os x #0-0]

Screenshots image

Runtime Env:

  • wdi5/wdio-ui5-service-version: 0.9.13
  • UI5 version: 1.104 and higher (till 1.108)
  • wdio-version: 7.25.1
  • node-version: v14.18.3
  • OS: macOS Monterey 12.6
  • Browser + Version: 107.0.5304.87

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (7 by maintainers)

Most upvoted comments

Hi everyone, I’ve got the same issue, experience the javascript error: Cannot read properties of undefined (reading 'waitForUI5Options')

@vobu I’ve created a public repo for you guys to reproduce the error.

The repo was created with the Fiori: Open Application Generator provided by VS Code using the SAPUI5 freestyle Application type with an empty page. My chrome is running at the latest version 107.0.5304.88.

The wdi5 was installed using the installation guide and the command npm init wdi5@latest provided by the quickstart section.

WDI5 Test Repo

Hi @xhton,

thanks for providing a public repo to reproduce your issue. I found the problem and it has to do with your usage of the goTo function in the before hook:

before(async () => {
    await wdi5.goTo("/"); 
  });

by simply adapting this to:

// or remove the before hook completely 
before(async () => {
    await wdi5.goTo("#");
  });

or completely removing it (as it is not necessary for your simple use case) the tests run 🟢. Of course we should improve the error message when the goTo function is not used the right way.

Best regards, Simon