Can some one help me how to identify the element using uiselector using webdriverio javascript


#1

I wrote the below code.
var sel = browser.element(‘new UiSelector().text(“Categories”)’);
browser.click(sel);

But when i execute this I am getting the below error.

Locator Strategy ‘css selector’ is not supported for this session
running
Error: Argument was an invalid selector (e.g. XPath/CSS).
at new Promise (node_modules/core-js/library/modules/es6.promise.js:191:7)
at element(“new UiSelector().text(“Categories”)”) - at Context.it (test/iviewTest.js:23:27)

npm ERR! Test failed. See above for more details.

I am new to webdriverio. Any help on this is highly appreciated.

Thanks in advance.


#2

any updates on above issue?