Closed Scotti-Scholter-Marichal closed 2 years ago
Hi @Scotti-Scholter-Marichal,
the behavior you described is actually intended. We store the already located controls internally to save time and roundtrips to the browser scope. To explicitly load the element again you can use forceSelect
.
const oSelector = {
forceSelect: true, // forces the test framework to again retrieve the control from the browser context
selector: {
id: "UI5control_ID",
viewName: "your.namespace.App"
}
Regards Simon
That makes sense! Thank you.
Best wishes, Scotti
I have ran into an issue when trying to get a control, that has been retrieved previously already. I am using browser.asControl with the same UI5 selector in both cases. The problem is, that the html web element of the button changes after a reload (id changes), but the browser.asControl() still fetches the old "version" of the button.
Problem description:
I did not save the button control in a variable. I always fetch the control inline with the browser.asControl method. For the tests we are using chrome version ^105.0.0.
Just to clarify further:
Does WDI5 automatically save the retrieved controls in some kind of cache (when you use the same selector)? Is this a bug or intended behavior? How can we make sure to always fetch the right / current control of an element that has been retrieved before?
Any advice would be greatly appreciated. Let me know if you need any more information or explanation on this topic. Thank you!