wdi5: Evaluation failed: DOMException: for List in Dialog

Hello,

we have a very very simple use case. We want to identify a list that is displayed in a dialog. For this we have the following very simple code:

const oSelector = {
        forceSelect: true,
        selector: {
            controlType: "sap.m.List"
        }
    };

const oList = browser.asControl(oSelector);

When we execute this then we get following error:

Evaluation failed: DOMException: Failed to execute 'querySelector' on 'Document': '#success,[object Object],myObject--dlgSelect-list-trigger,getList,getContent,addContent,insertContent,removeContent,removeAllContent,indexOfContent,destroyContent,bindContent,unbindContent,getContentAnnouncement,getType,setType,getUnread,setUnread,getSelected,setSelected,getCounter,setCounter,getHighlight,setHighlight,getAriaLabelledBy,addAriaLabelledBy,removeAriaLabelledBy,removeAllAriaLabelledBy,attachTap,detachTap,fireTap,attachDetailTap,detachDetailTap,fireDetailTap,attachPress,detachPress,firePress,attachDetailPress,detachDetailPress,fireDetailPress,init,invalidate,getBindingContextPath,isSelectedBoundTwoWay,getListProperty,informList,informSelectedChange,getAccessibilityType,getGroupAnnouncement,getAccessibilityDescription,getAccessibilityInfo,getMode,updateAccessibilityState,getDeleteControl,getDetailControl,getNavigationControl,getSingleSelectControl,getMultiSelectControl,getModeControl,getTypeControl,destroyControls,isActionable,exit,isSelectable,isSelected,updateSelectedDOM,setParent,setBindingContext,isGroupHeader,isIncludedIntoSelection,hasActiveType,setActive,ontap,ontouchstart,ontouchmove,ontouchend,ontouchcancel,onsapspace,onsapenter,onsapdelete,onkeydown,getTabbables,onsaptabnext,onsaptabprevious,onfocusin,onsapup,oncontextmenu,onsapdown,getBlocked,setBlocked,getBusy,setBusy,getBusyIndicatorDelay,setBusyIndicatorDelay,getBusyIndicatorSize,setBusyIndicatorSize,getVisible,setVisible,getFieldGroupIds,setFieldGroupIds,attachValidateFieldGroup,detachValidateFieldGroup,fireValidateFieldGroup,clone,addStyleClass,removeStyleClass,toggleStyleClass,hasStyleClass,isActive,rerender,getDomRef,allowTextSelection,attachBrowserEvent,detachBrowserEvent,placeAt,onselectstart,getIdForLabel,destroy,isBusy,getControlsByFieldGroupId,checkFieldGroupIds,triggerValidateFieldGroup,getTooltip,setTooltip,destroyTooltip,getCustomData,addCustomData,insertCustomData,removeCustomData,removeAllCustomData,indexOfCustomData,destroyCustomData,getLayoutData,setLayoutData,destroyLayoutData,getDependents,addDependent,insertDependent,removeDependent,removeAllDependents,indexOfDependent,destroyDependents,getDragDropConfig,addDragDropConfig,insertDragDropConfig,removeDragDropConfig,removeAllDragDropConfig,indexOfDragDropConfig,destroyDragDropConfig,getInterface,toString,prop,getUIArea,fireEvent,addDelegate,removeDelegate,addEventDelegate,removeEventDelegate,getFocusDomRef,focus,getFocusInfo,applyFocusInfo,getTooltip_AsString,getTooltip_Text,data,findElements,bindElement,unbindElement,getElementBinding,getDomRefForSetting,register,deregister,attachValidationSuccess,detachValidationSuccess,fireValidationSuccess,attachValidationError,detachValidationError,fireValidationError,attachParseError,detachParseError,fireParseError,attachFormatError,detachFormatError,fireFormatError,attachModelContextChange,detachModelContextChange,fireModelContextChange,applySettings,getId,setProperty,getProperty,validateProperty,isPropertyInitial,resetProperty,getOriginInfo,setAssociation,getAssociation,addAssociation,removeAssociation,removeAllAssociation,validateAggregation,setAggregation,indexOfAggregation,insertAggregation,addAggregation,removeAggregation,removeAllAggregation,destroyAggregation,isInvalidateSuppressed,getParent,isBinding,extractBindingInfo,getBindingInfo,bindObject,bindContext,unbindContext,unbindObject,bindProperty,unbindProperty,updateProperty,updateModelProperty,bindAggregation,unbindAggregation,updateAggregation,refreshAggregation,propagateMessages,isTreeBinding,updateBindings,isBound,getObjectBinding,getEventingParent,getBinding,getBindingPath,setElementBindingContext,updateBindingContext,getBindingContext,setModel,addPropagationListener,removePropagationListener,getPropagationListeners,propagateProperties,getModel,hasModel,findAggregatedObjects,attachEvent,attachEventOnce,detachEvent,hasListeners,isA,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,valueOf,toLocaleString,__executeElement_1,success,[object Object],ylpplfilialauswlib--dlgSelect-list-trigger,getList,getContent,addContent,insertContent,removeContent,removeAllContent,indexOfContent,destroyContent,bindContent,unbindContent,getContentAnnouncement,getType,setType,getUnread,setUnread,getSelected,setSelected,getCounter,setCounter,getHighlight,setHighlight,getAriaLabelledBy,addAriaLabelledBy,removeAriaLabelledBy,removeAllAriaLabelledBy,attachTap,detachTap,fireTap,attachDetailTap,detachDetailTap,fireDetailTap,attachPress,detachPress,firePress,attachDetailPress,detachDetailPress,fireDetailPress,init,invalidate,getBindingContextPath,isSelectedBoundTwoWay,getListProperty,informList,informSelectedChange,getAccessibilityType,getGroupAnnouncement,getAccessibilityDescription,getAccessibilityInfo,getMode,updateAccessibilityState,getDeleteControl,getDetailControl,getNavigationControl,getSingleSelectControl,getMultiSelectControl,getModeControl,getTypeControl,destroyControls,isActionable,exit,isSelectable,isSelected,updateSelectedDOM,setParent,setBindingContext,isGroupHeader,isIncludedIntoSelection,hasActiveType,setActive,ontap,ontouchstart,ontouchmove,ontouchend,ontouchcancel,onsapspace,onsapenter,onsapdelete,onkeydown,getTabbables,onsaptabnext,onsaptabprevious,onfocusin,onsapup,oncontextmenu,onsapdown,getBlocked,setBlocked,getBusy,setBusy,getBusyIndicatorDelay,setBusyIndicatorDelay,getBusyIndicatorSize,setBusyIndicatorSize,getVisible,setVisible,getFieldGroupIds,setFieldGroupIds,attachValidateFieldGroup,detachValidateFieldGroup,fireValidateFieldGroup,clone,addStyleClass,removeStyleClass,toggleStyleClass,hasStyleClass,isActive,rerender,getDomRef,allowTextSelection,attachBrowserEvent,detachBrowserEvent,placeAt,onselectstart,getIdForLabel,destroy,isBusy,getControlsByFieldGroupId,checkFieldGroupIds,triggerValidateFieldGroup,getTooltip,setTooltip,destroyTooltip,getCustomData,addCustomData,insertCustomData,removeCustomData,removeAllCustomData,indexOfCustomData,destroyCustomData,getLayoutData,setLayoutData,destroyLayoutData,getDependents,addDependent,insertDependent,removeDependent,removeAllDependents,indexOfDependent,destroyDependents,getDragDropConfig,addDragDropConfig,insertDragDropConfig,removeDragDropConfig,removeAllDragDropConfig,indexOfDragDropConfig,destroyDragDropConfig,getInterface,toString,prop,getUIArea,fireEvent,addDelegate,removeDelegate,addEventDelegate,removeEventDelegate,getFocusDomRef,focus,getFocusInfo,applyFocusInfo,getTooltip_AsString,getTooltip_Text,data,findElements,bindElement,unbindElement,getElementBinding,getDomRefForSetting,register,deregister,attachValidationSuccess,detachValidationSuccess,fireValidationSuccess,attachValidationError,detachValidationError,fireValidationError,attachParseError,detachParseError,fireParseError,attachFormatError,detachFormatError,fireFormatError,attachModelContextChange,detachModelContextChange,fireModelContextChange,applySettings,getId,setProperty,getProperty,validateProperty,isPropertyInitial,resetProperty,getOriginInfo,setAssociation,getAssociation,addAssociation,removeAssociation,removeAllAssociation,validateAggregation,setAggregation,indexOfAggregation,insertAggregation,addAggregation,removeAggregation,removeAllAggregation,destroyAggregation,isInvalidateSuppressed,getParent,isBinding,extractBindingInfo,getBindingInfo,bindObject,bindContext,unbindContext,unbindObject,bindProperty,unbindProperty,updateProperty,updateModelProperty,bindAggregation,unbindAggregation,updateAggregation,refreshAggregation,propagateMessages,isTreeBinding,updateBindings,isBound,getObjectBinding,getEventingParent,getBinding,getBindingPath,setElementBindingContext,updateBindingContext,getBindingContext,setModel,addPropagationListener,removePropagationListener,getPropagationListeners,propagateProperties,getModel,hasModel,findAggregatedObjects,attachEvent,attachEventOnce,detachEvent,hasListeners,isA,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,valueOf,toLocaleString,success,[object Object],ylpplfilialauswlib--dlgSelect-list-trigger,getList,getContent,addContent,insertContent,removeContent,removeAllContent,indexOfContent,destroyContent,bindContent,unbindContent,getContentAnnouncement,getType,setType,getUnread,setUnread,getSelected,setSelected,getCounter,setCounter,getHighlight,setHighlight,getAriaLabelledBy,addAriaLabelledBy,removeAriaLabelledBy,removeAllAriaLabelledBy,attachTap,detachTap,fireTap,attachDetailTap,detachDetailTap,fireDetailTap,attachPress,detachPress,firePress,attachDetailPress,detachDetailPress,fireDetailPress,init,invalidate,getBindingContextPath,isSelectedBoundTwoWay,getListProperty,informList,informSelectedChange,getAccessibilityType,getGroupAnnouncement,getAccessibilityDescription,getAccessibilityInfo,getMode,updateAccessibilityState,getDeleteControl,getDetailControl,getNavigationControl,getSingleSelectControl,getMultiSelectControl,getModeControl,getTypeControl,destroyControls,isActionable,exit,isSelectable,isSelected,updateSelectedDOM,setParent,setBindingContext,isGroupHeader,isIncludedIntoSelection,hasActiveType,setActive,ontap,ontouchstart,ontouchmove,ontouchend,ontouchcancel,onsapspace,onsapenter,onsapdelete,onkeydown,getTabbables,onsaptabnext,onsaptabprevious,onfocusin,onsapup,oncontextmenu,onsapdown,getBlocked,setBlocked,getBusy,setBusy,getBusyIndicatorDelay,setBusyIndicatorDelay,getBusyIndicatorSize,setBusyIndicatorSize,getVisible,setVisible,getFieldGroupIds,setFieldGroupIds,attachValidateFieldGroup,detachValidateFieldGroup,fireValidateFieldGroup,clone,addStyleClass,removeStyleClass,toggleStyleClass,hasStyleClass,isActive,rerender,getDomRef,allowTextSelection,attachBrowserEvent,detachBrowserEvent,placeAt,onselectstart,getIdForLabel,destroy,isBusy,getControlsByFieldGroupId,checkFieldGroupIds,triggerValidateFieldGroup,getTooltip,setTooltip,destroyTooltip,getCustomData,addCustomData,insertCustomData,removeCustomData,removeAllCustomData,indexOfCustomData,destroyCustomData,getLayoutData,setLayoutData,destroyLayoutData,getDependents,addDependent,insertDependent,removeDependent,removeAllDependents,indexOfDependent,destroyDependents,getDragDropConfig,addDragDropConfig,insertDragDropConfig,removeDragDropConfig,removeAllDragDropConfig,indexOfDragDropConfig,destroyDragDropConfig,getInterface,toString,prop,getUIArea,fireEvent,addDelegate,removeDelegate,addEventDelegate,removeEventDelegate,getFocusDomRef,focus,getFocusInfo,applyFocusInfo,getTooltip_AsString,getTooltip_Text,data,findElements,bindElement,unbindElement,getElementBinding,getDomRefForSetting,register,deregister,attachValidationSuccess,detachValidationSuccess,fireValidationSuccess,attachValidationError,detachValidationError,fireValidationError,attachParseError,detachParseError,fireParseError,attachFormatError,detachFormatError,fireFormatError,attachModelContextChange,detachModelContextChange,fireModelContextChange,applySettings,getId,setProperty,getProperty,validateProperty,isPropertyInitial,resetProperty,getOriginInfo,setAssociation,getAssociation,addAssociation,removeAssociation,removeAllAssociation,validateAggregation,setAggregation,indexOfAggregation,insertAggregation,addAggregation,removeAggregation,removeAllAggregation,destroyAggregation,isInvalidateSuppressed,getParent,isBinding,extractBindingInfo,getBindingInfo,bindObject,bindContext,unbindContext,unbindObject,bindProperty,unbindProperty,updateProperty,updateModelProperty,bindAggregation,unbindAggregation,updateAggregation,refreshAggregation,propagateMessages,isTreeBinding,updateBindings,isBound,getObjectBinding,getEventingParent,getBinding,getBindingPath,setElementBindingContext,updateBindingContext,getBindingContext,setModel,addPropagationListener,removePropagationListener,getPropagationListeners,propagateProperties,getModel,hasModel,findAggregatedObjects,attachEvent,attachEventOnce,detachEvent,hasListeners,isA,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,valueOf,toLocaleString' is not a valid selector.

[Chrome 89.0.4389.114 darwin #0-0]     at ExecutionContext._evaluateInternal (/node_modules/puppeteer-core/lib/cjs/puppeteer/common/ExecutionContext.js:218:19)
[Chrome 89.0.4389.114 darwin #0-0]     at processTicksAndRejections (node:internal/process/task_queues:94:5)
[Chrome 89.0.4389.114 darwin #0-0]     at async ElementHandle.evaluateHandle (yrtbfinv/node_modules/puppeteer-core/lib/cjs/puppeteer/common/JSHandle.js:120:16)
[Chrome 89.0.4389.114 darwin #0-0]     at async Object.internalHandler.queryOne (/node_modules/puppeteer-core/lib/cjs/puppeteer/common/QueryHandler.js:24:30)
[Chrome 89.0.4389.114 darwin #0-0]     at async DOMWorld.$ (/node_modules/puppeteer-core/lib/cjs/puppeteer/common/DOMWorld.js:95:23)
[Chrome 89.0.4389.114 darwin #0-0]     at async DevToolsDriver.findElement (/node_modules/devtools/build/utils.js:88:15)
[Chrome 89.0.4389.114 darwin #0-0]     at async Browser.wrappedCommand (node_modules/devtools/build/devtoolsdriver.js:75:26)
[Chrome 89.0.4389.114 darwin #0-0]     at global.$ (/node_modules/@wdio/runner/build/index.js:181:42)
[Chrome 89.0.4389.114 darwin #0-0]     at WDI5._getControl (/node_modules/wdio-ui5-service/src/lib/WDI5.js:574:45)
[Chrome 89.0.4389.114 darwin #0-0]     at new WDI5 (/node_modules/wdio-ui5-service/src/lib/WDI5.js:36:36)
[Chrome 89.0.4389.114 darwin #0-0]     at Browser.<anonymous> (/node_modules/wdio-ui5-service/src/lib/wdioUi5-index.js:467:33)
[Chrome 89.0.4389.114 darwin #0-0]     at Browser.next [as asControl] (/node_modules/@wdio/utils/build/monad.js:149:33)

Looks like a bug in WDI5. The library was presented at the UI5 Con. Is this production ready or rather beta stage?

Regards, Nils

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

yep, closing this. thanks for your efforts so far!!!

An possible fix would be:

        while (Array.isArray(result[0])) {
            result = result[0];
        }

        // save the webdriver representation by control id
        if (result[2]) {
            // only if the result is valid
            this._webdriverRepresentation = $(`#${result[2]}`);
        }

@vobu What do you think? Should I create an PR? Seems a problem with Fiori 1.60

well, most certainly! PRs mega-welcome! might take a look at https://github.com/js-soft/wdi5/blob/1651f78d76b7b7e5b8c0fe55295006b151079cf8/wdio-ui5-service/src/lib/wdioUi5-index.js#L84 where some version checking is done

I have found the issue but currently thinking how to fix.

The array returned is incorrect. This is an array in array in a array https://github.com/js-soft/wdi5/blob/1651f78d76b7b7e5b8c0fe55295006b151079cf8/wdio-ui5-service/src/lib/WDI5.js#L574

Bildschirmfoto 2021-04-13 um 15 33 59

If I change the line to:

  this._webdriverRepresentation = $(`#${result[2][2][2]}`);

All is working fine. But this can not be the fix. The done handler seems to be corrupted.