Skip to content

Latest commit

 

History

History

fill-in-element

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

fillInElement(element, text)

Type text into an element

Example

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()

Parameters

Returns

  • promise (Promise)

Details

fillInElement focuses the element, types the text, and blurs the element. It does not clear away any existing text.