Closed nair-sumesh closed 2 years ago
Hi, assuming your first code example successfully returns an UI5 control. I suggest to check if the -inner
element is actually a UI5 control. Usually they are not.
Hi, assuming your first code example successfully returns an UI5 control. I suggest to check if the
-inner
None of the code ( I tried different permutations and combinations), returned a UI5 control.
What working for me is the native WDIO code ( which I believe is not UI5 control as such, its just a DOM element ).
Hi, assuming your first code example successfully returns an UI5 control. I suggest to check if the
-inner
None of the code ( I tried different permutations and combinations), returned a UI5 control.What working for me is the native WDIO code ( which I believe is not UI5 control as such, its just a DOM element ).
yep, that's right. and given that, even when you could retrieve it in wdi5
, what could you do with a non-UI5 element 😄 ?
you're obviously trying to work with wdi5
on a FE app. we haven't really looked at how to cope from a wdi5
-perspective with these auto-generated IDs. technically it doesn't make a difference, as visible UI5 elements in a view are selectable by wdi5
. but from a best-practice POV, this is interesting. so i put in on the (hopefully soon public) roadmap and we'll get to it as part of the ongoing documentation effort. ok for you?
Ok for me, however almost all my apps are either FE or an hybrid, therefore, WDI5 will not be helpful until support for FE is not available.
I will wait till the feature is available.
WDI5 works for OVP FE apps. I was able to select a card header.
Ok for me, however almost all my apps are either FE or an hybrid, therefore, WDI5 will not be helpful until support for FE is not available. I will wait till the feature is available.
well, as i mentioned previously, there‘s no technical reason for wdi5 not to work with FE apps. it‘s just that we have no „recipe“ in the docs for it yet.
following your selector attempt, loose the inner
part of the id and properly aim for a valid UI5 control id and you should be good to go.
await browser.asControl({
selector: {
id: /xMMMMMM--some-table-id$/
}
}).getTitle()
WDI5 works for OVP FE apps. I was able to select a card header.
proves my point above :)
for me it seems to fail anyhow I try to locate a button with a similar ID structure (with dots and colons as in an FE apps usually).
wdi5 finds the control via partial ID/escaped ID/other descriptors, but then wdio gets a findElement command (by wdi5 or not sure how) which fails:
[0-0] 2022-01-26T11:56:23.182Z INFO webdriver: COMMAND findElement("css selector", "#****::LineItem::StandardAction::Create")
[0-0] 2022-01-26T11:56:23.183Z INFO webdriver: [POST] http://localhost:9515/session/cea5d22fbef2fb97044672e9a6d7d1d5/element
[0-0] 2022-01-26T11:56:23.183Z INFO webdriver: DATA {
[0-0] using: 'css selector',
[0-0] value: '#****::LineItem::StandardAction::Create'
[0-0] }
[0-0] 2022-01-26T11:56:23.201Z DEBUG webdriver: request failed due to response error: invalid selector
with all of these locators:
browser.asControl({selector:{controlType: 'sap.m.Button', id: '***::LineItem::StandardAction::Create'}})
browser.asControl({selector:{controlType: 'sap.m.Button', properties: { text: 'Create' }}})
browser.asControl({selector:{controlType: 'sap.m.Button', id: /Create/}})
may help why OVP works: OVP does not use colons in generated IDs only hypens and dots which seem to be fine
may help why OVP works: OVP does not use colons in generated IDs only hypens and dots which seem to be fine
interesting. i'll flag this issue accordingly as enhancement.
btw: your regex selector...
browser.asControl({selector:{controlType: 'sap.m.Button', properties: { text: 'Create' }}})
browser.asControl({selector:{controlType: 'sap.m.Button', id: /Create/}})
...will never match the partial id string :LineItem::StandardAction::Create
.
this one should:
browser.asControl({selector:{controlType: 'sap.m.Button', id: /.*Create$/}})
Ok for me, however almost all my apps are either FE or an hybrid, therefore, WDI5 will not be helpful until support for FE is not available. I will wait till the feature is available.
well, as i mentioned previously, there‘s no technical reason for wdi5 not to work with FE apps. it‘s just that we have no „recipe“ in the docs for it yet. following your selector attempt, loose the
inner
part of the id and properly aim for a valid UI5 control id and you should be good to go.await browser.asControl({ selector: { id: /xMMMMMM--some-table-id$/ } }).getTitle()
WDI5 works for OVP FE apps. I was able to select a card header.
proves my point above :)
Loosing the inner
part did not work
Error is thrown after retrieving the UI5 element when the webdriver representation is loaded additionally.
anyways ID is not supported see: https://webdriver.io/docs/selectors/#id-attribute
@vobu I suggest to investigate if we can switch to xPath webdriver selector
Testcase prepared: https://github.com/js-soft/wdi5/commit/33d5d3ffced1bc87b18754be3e90a15fe36388dd
let's look into sap.fe.test
from https://sapui5.hana.ondemand.com/#/api/sap.fe.test - dev tutorial over at https://developers.sap.com/group.fiori-elements-mockserver-opa.html
as aligned with the SAP colleagues, integration the "testing library" is worthwhile feat :)
TODO: @dominikfeininger add selector structure validation
manual selection of a FE control is now possible with wdi5 0.9.x
since #159 went in
Hi,
Some of the elements of the UI5 have complex id naming schema (separated with '.', '::',, '-','--'.) For such elements, I received below cryptic error. I am not sure how to read this error.
Error
The Code
Note:
However, when same done on WDI5 (i.e. appending -inner at the end of the id), gives an error
code