wdi5
wdi5 copied to clipboard
Cannot read data from sap.m.Table
Describe the bug During my test I sort a sap.m.Table. I want to assert that the data displayed is indeed sorted ascending. I try to read the data from row 1 and compare it to data from row 2. After sorting the table I read the first row:
firstrow = await mytable.getItems(0)
Then I obtain the context of that row:
rowcontext = await firstrow.getBindingContext('myModel')
Then I try to get part of the model bound to this row, so that I can read data from it:
myobject = await rowcontext.getObject()
Here I get the error:
rowcontext.getObject is not a function
To Reproduce Use a sap.m.Table in your app, bound to a model, and try the above code to read data from it.
Expected behavior I expect rowcontext.getObject() to return part of the model (in my case, JSON model) which is bound to the first table row. In the browser the above code works.
If the above is not the correct way to read data from a sap.m.Table in a wdi5 test then please describe the correct way.
Runtime Env:
-
wdi5/wdio-ui5-service
-version: 0.9.12 -
UI5
version: 1.96.0 -
wdio
-version: 7.24.0 -
node
-version: v14.18.1 - OS: Windows 10
- Browser + Version chrome 101.0.5150.0
Additional context
Test is run manually with npm run wdi5
from VSCode JS debug terminal.
yeah, calling methods on a UI5 plain object currently break, see #269.
in your case, rowcontext
is not a control anymore and the wdi5
api breaks.
but we (aka @dominikfeininger) are on it :)
hey 👋 - silence for 30 days 🤐 ... anybody? 😀
Still waiting for #269 to complete.