fill: Page class: Fill input field

View source: R/actions.R

fillR Documentation

Page class: Fill input field

Description

The fill function fills an input field with the specified text. It can either locate the input field using a provided selector or by referencing an element previously located.

Usage

fill(page_df, text, selector = NULL)

Arguments

page_df

A data frame containing page information, including the page_id column. This data frame is used to identify the page object where the input field should be filled.

text

A character string representing the text to fill in the input field.

selector

(Optional) A character string representing the selector of the input field. If provided, the input field will be located using the selector. If not provided, the elem_id column from page_df will be used to reference a previously located element.

Value

The updated page_df data frame.

Examples

# Create a page_df data frame
page_df <- data.frame(page_id = "my_page")

# Fill an input field using a selector
fill(page_df, "Hello, World!", selector = "#myInput")

# Fill an input field using a previously located element
page_df <- get_by_role(page_df, "textbox")
fill(page_df, "Hello, World!")
%>%

benjaminguinaudeau/playwrightr documentation built on Nov. 8, 2023, 8:36 p.m.