Type text into an element
import { openBrowser, openTab, findElement, fillInElement } from 'puppet-strings'
async function run() {
const browser = await openBrowser('google-chrome')
const tab = await openTab(browser, 'https://www.npmjs.com/')
const searchBox = await findElement(tab, '[placeholder="Search packages"]')
await fillInElement(searchBox, 'puppet-strings')
}
run()
element
(Element)text
(string)
promise
(Promise)
fillInElement
focuses the element
, types the text
, and blurs the
element
. It does not clear away any existing text.