The code now:
await page.type('#filterdataTable > div.widget > input', "1234");
Can I use XPath instead of this CSS Selector?
The code now:
await page.type('#filterdataTable > div.widget > input', "1234");
Can I use XPath instead of this CSS Selector?
You can use page.$x() to obtain the ElementHandle of the element you want to select.
Then you can use elementHandle.type() to type text into the input field.
const example = await page.$x('//*[@id="filterdataTable"]/div[contains(concat(" ", normalize-space(@class), " "), " widget ")]/input');
await example[0].type('1234');
Use
const [selector] = await scope.context.currentPage.$x(path);
await scope.context.currentPage.evaluate(
(element, value) => element.value = value, selector, text);
where xpath is he XML path and text holds the characters you want to type.