A Widget
object represents a Shiny input or output control, and provides
methods for finer grained interaction.
Methods
Method new()
Create new Widget
Usage
Widget$new(name, element, type, iotype = c("input", "output"))
Arguments
name
Name of a Shiny widget.
element
webdriver::Element
type
Widget type
iotype
Input/output type.
Method getName()
Control id (i.e. inputId
or outputId
that control
was created with).
Method getHtml()
retrieve the underlying HTML for a widget
Method getType()
Widget type, e.g. textInput
, selectInput
.
Method getIoType()
Is this an input or output control?
Is this an input control?
Method isOutput()
Is this an output control?
Method getValue()
Get current value of control.
Method setValue()
Set value of control.
Arguments
value
Value to set for the widget.
Method click()
scrolls the element into view, then clicks the in-view
centre point of it.
Method sendKeys()
Send specified key presses to control.
Arguments
keys
Keys to send to the widget or the app. See webdriver::key
for how to specific special keys.
Method listTabs()
Lists the tab names of a shiny::tabsetPanel()
.
It fails for other types of widgets.
Method uploadFile()
Upload a file to a shiny::fileInput()
.
It fails for other types of widgets.
Usage
Widget$uploadFile(filename)
Arguments
filename
Path to file to upload
Method clone()
The objects of this class are cloneable with this method.
Usage
Widget$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.