Package app.peac.core.service.rpa
Class RpaDriver
java.lang.Object
app.peac.core.service.rpa.RpaDriver
- All Implemented Interfaces:
AutoCloseable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclickOnElemBy(org.openqa.selenium.By locator) voidclose()<T> TExecutes JavaScript code on RPA node.<T> TExecutes JavaScript code on RPA node with ability to turn off logging of expected errorsList<org.openqa.selenium.WebElement>findAllBy(Duration duration, org.openqa.selenium.support.ui.ExpectedCondition<List<org.openqa.selenium.WebElement>> condition) List<org.openqa.selenium.WebElement>findAllBy(org.openqa.selenium.By selector) Find all elements matching given descriptor.List<org.openqa.selenium.WebElement>findAllBy(org.openqa.selenium.support.ui.ExpectedCondition<List<org.openqa.selenium.WebElement>> condition) org.openqa.selenium.WebElementfindBy(Duration duration, org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement> condition) org.openqa.selenium.WebElementfindBy(org.openqa.selenium.By selector) Finds the first element matching given descriptororg.openqa.selenium.WebElementfindBy(org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement> condition) org.openqa.selenium.interactions.Actionsorg.openqa.selenium.WebDrivervoidorg.openqa.selenium.WebElementmoveToElement(org.openqa.selenium.By locator) voidopenBrowserOn(String url) voidpressKey(org.openqa.selenium.Keys key) voidpressKeys(org.openqa.selenium.Keys... keys) voidvoidvoidvoidsendKeysBy(org.openqa.selenium.By locator, String value) voidvoidwaitForMilliSec(long ms) voidwaitForSec(long seconds)
-
Constructor Details
-
RpaDriver
-
-
Method Details
-
openBrowserOn
-
waitForMilliSec
public void waitForMilliSec(long ms) -
waitForSec
public void waitForSec(long seconds) -
waitFor
-
imitateUserWait
public void imitateUserWait() -
findBy
public org.openqa.selenium.WebElement findBy(org.openqa.selenium.By selector) Finds the first element matching given descriptor- Parameters:
selector- any selector like: By.id(), By.name(), By.cssSelector("[CLASS:Edit; INSTANCE:1]")- Returns:
WebElement
-
findBy
public org.openqa.selenium.WebElement findBy(org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement> condition) -
findBy
public org.openqa.selenium.WebElement findBy(Duration duration, org.openqa.selenium.support.ui.ExpectedCondition<org.openqa.selenium.WebElement> condition) -
check
-
findAllBy
Find all elements matching given descriptor. Method returns a UiElementCollection which is a list of SelenideElement objects that can be iterated, and at the same time is an implementation of SelenideElement interface, meaning that you can call methods .sendKeys(), click() etc. on it.- Parameters:
selector- any selector like: By.id(), By.name(), By.cssSelector("[CLASS:Edit; INSTANCE:1]")- Returns:
- list with UiElement objects or empty list if element was no found
-
findAllBy
-
findAllBy
-
clickOnElemBy
public void clickOnElemBy(org.openqa.selenium.By locator) -
sendKeysBy
-
pressKey
public void pressKey(org.openqa.selenium.Keys key) -
pressKeys
public void pressKeys(org.openqa.selenium.Keys... keys) -
scrollToPageBottom
public void scrollToPageBottom() -
scrollToPageBottomWithRefreshCheck
public void scrollToPageBottomWithRefreshCheck() -
moveToElement
public org.openqa.selenium.WebElement moveToElement(org.openqa.selenium.By locator) -
refreshPage
public void refreshPage() -
executeJS
Executes JavaScript code on RPA node.- Parameters:
script- script code as a String- Returns:
- One of Boolean, Long, String, List or SelenideElement. Or null.
-
executeJS
Executes JavaScript code on RPA node with ability to turn off logging of expected errors- Parameters:
script- script code as a String- Returns:
- One of Boolean, Long, String, List or SelenideElement. Or null.
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
getConfig
-
getDriver
public org.openqa.selenium.WebDriver getDriver() -
getActions
public org.openqa.selenium.interactions.Actions getActions()
-