Closed zimea closed 2 years ago
+1 - I am struggling with a Select Picker and getAggregation("content") which resolves in a stale element reference in the second call. I can provide an example project if you need to see this issue in real life.
Edit: @vobu @dominikfeininger Attached you can see a failing sample project (german feature file, but should not be a problem).
Edit2: of course we also got a workaround - cleanup of the internal WDI5 control cache:
Object.keys(browser._controls).forEach(sKey => { if (browser._controls[sKey]._context) { delete browser._controls[sKey]; } });
Cheers, Bas sample_wdi5.zip
Edit2: of course we also got a workaround - cleanup of the internal WDI5 control cache:
Object.keys(browser._controls).forEach(sKey => { if (browser._controls[sKey]._context) { delete browser._controls[sKey]; } });
thanks for digging into this! now that you (and @Lea-Zim 😄 ) have identified the issue, would you come fwd and PR this?!? now that would be rad ;)
@vobu I had a quick look. The solution should be quite simple, you are calling asControl twice in WDI5.js (in _retrieveElements and _retrieveElement) - there the this._forceSelect Option should be inserted as there it is lost. #96
The parameter forceSelect: true can be used to update the internally stored references; however, if the retrieved control is used to call aggregations (e.g. ListControl.getItems(), dialogContro.getButtons()), the resulting reference is always reused. forceSelect: true could be propagated to the aggregated controls to avoid errors due to an outdated reference.