shadow-class {shadowr} | R Documentation |
CLASS shadow
Description
Selenium plugin to manage multiple levels of shadow elements on web page. Returning a RSelenium::WebElement
which you can access like you used to.
Usage
find_element(shadowObject, css_selector, element)
## S4 method for signature 'shadow,character,missing'
find_element(shadowObject, css_selector, element)
## S4 method for signature 'shadow,character,webElement'
find_element(shadowObject, css_selector, element)
find_elements(shadowObject, css_selector, element)
## S4 method for signature 'shadow,character,missing'
find_elements(shadowObject, css_selector, element)
## S4 method for signature 'shadow,character,webElement'
find_elements(shadowObject, css_selector, element)
get_shadow_element(shadowObject, css_selector, element)
## S4 method for signature 'shadow,character,webElement'
get_shadow_element(shadowObject, css_selector, element)
get_all_shadow_element(shadowObject, css_selector, element)
## S4 method for signature 'shadow,character,webElement'
get_all_shadow_element(shadowObject, css_selector, element)
get_parent_element(shadowObject, element)
## S4 method for signature 'shadow,webElement'
get_parent_element(shadowObject, element)
get_sibling_element(shadowObject, element, css_selector)
## S4 method for signature 'shadow,webElement,character'
get_sibling_element(shadowObject, element, css_selector)
get_previous_sibling_element(shadowObject, element)
## S4 method for signature 'shadow,webElement'
get_previous_sibling_element(shadowObject, element)
get_next_sibling_element(shadowObject, element)
## S4 method for signature 'shadow,webElement'
get_next_sibling_element(shadowObject, element)
scroll_to(shadowObject, element)
## S4 method for signature 'shadow,webElement'
scroll_to(shadowObject, element)
is_checked(shadowObject, element)
## S4 method for signature 'shadow,webElement'
is_checked(shadowObject, element)
is_disabled(shadowObject, element)
## S4 method for signature 'shadow,webElement'
is_disabled(shadowObject, element)
is_visible(shadowObject, element)
## S4 method for signature 'shadow,webElement'
is_visible(shadowObject, element)
Arguments
shadowObject |
the shadow class |
css_selector |
selector string to find a web element |
element |
a web element |
Value
Depends on the method, either a RSelenium::WebElement
or a boolean
.
Functions
-
find_element,shadow,character,missing-method
: Use this method if want single element -
find_element,shadow,character,webElement-method
: Use this if you want to find a single elements from parent object -
find_elements,shadow,character,missing-method
: Use this if you want to find all elements -
find_elements,shadow,character,webElement-method
: Use this if you want to find all elements from parent object -
get_shadow_element,shadow,character,webElement-method
: Use this if you want to find a single element from parent -
get_all_shadow_element,shadow,character,webElement-method
: Use this if you want to find all elements from parent -
get_parent_element,shadow,webElement-method
: Use this to get the parent element if web element -
get_sibling_element,shadow,webElement,character-method
: Use this to get adjacent(sibling) element -
get_previous_sibling_element,shadow,webElement-method
: Use this to get previous adjacent(sibling) element -
get_next_sibling_element,shadow,webElement-method
: Use this to get next adjacent(sibling) element -
scroll_to,shadow,webElement-method
: Use this to scroll to web element -
is_checked,shadow,webElement-method
: Use this if you want to check if checkbox is selected -
is_disabled,shadow,webElement-method
: Use this if you want to check if element is disabled -
is_visible,shadow,webElement-method
: Use this if you want to find visibility of element
Slots
driver
The shadow class takes a Remote Driver
javascript_library
the selenium plugin
See Also
https://github.com/ricilandolt/shadowr for examples
Examples
## Not run:
library(shadowr)
library(RSelenium)
remDr <- RSelenium::remoteDriver(
remoteServerAddr = "host.docker.internal",
port = 4445 , browser = "chrome")
remDr$open(silent = TRUE)
remDr$navigate(url)
shadow_rd <- shadow(remDr)
element <- find_element(shadow_rd, 'paper-tab[title="Settings"]')
elements <- find_elements(shadow_rd, 'paper-tab[title="Settings"]')
element$getElementText()
library(shadowr)
library(RSelenium)
remDr <- RSelenium::remoteDriver(
remoteServerAddr = "host.docker.internal",
port = 4445 , browser = "chrome")
remDr$open(silent = TRUE)
remDr$navigate(url)
shadow_rd <- shadow(remDr)
element <- find_element(shadow_rd, 'input[title="The name of the employee"]')
elements <- find_elements(shadow_rd, 'input[title="The name of the employee"]')
element$getElementText()
library(shadowr)
library(RSelenium)
remDr <- RSelenium::remoteDriver(
remoteServerAddr = "host.docker.internal",
port = 4445 , browser = "chrome")
remDr$open(silent = TRUE)
remDr$navigate(url)
shadow_rd <- shadow(remDr)
element <- find_element(shadow_rd, "properties-page#settingsPage>textarea#textarea")
element$getElementText()
## End(Not run)