InvalidSelectorError: invalid selector: Unable to locate an element with the xpath expression

前端 未结 1 1813
野的像风
野的像风 2021-01-25 18:28

Following is html snippet element

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-25 19:15

    This error message...

    invalid or illegal selector was specified
    

    ...implies that the Locator Strategy you have constructed was not a valid locator.

    To locate the element with text as Tile View you can use the following xpath :

    "//a[@ng-click=\"nodes.setViewType('tiles',true)\"]"
    

    Note : As the element is an Angular element to interact with it you have to induce a waiter for the element to be clickable.

    0 讨论(0)
提交回复
热议问题