Class RpaDriver

java.lang.Object
app.peac.core.service.rpa.RpaDriver
All Implemented Interfaces:
AutoCloseable

public class RpaDriver extends Object implements AutoCloseable
  • Constructor Details

  • Method Details

    • openBrowserOn

      public void openBrowserOn(String url)
    • waitForMilliSec

      public void waitForMilliSec(long ms)
    • waitForSec

      public void waitForSec(long seconds)
    • waitFor

      public void waitFor(TimeUnit unit, long amount)
    • 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

      public Boolean check(org.openqa.selenium.support.ui.ExpectedCondition<Boolean> condition)
    • findAllBy

      public List<org.openqa.selenium.WebElement> findAllBy(org.openqa.selenium.By selector)
      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

      public List<org.openqa.selenium.WebElement> findAllBy(org.openqa.selenium.support.ui.ExpectedCondition<List<org.openqa.selenium.WebElement>> condition)
    • findAllBy

      public List<org.openqa.selenium.WebElement> findAllBy(Duration duration, org.openqa.selenium.support.ui.ExpectedCondition<List<org.openqa.selenium.WebElement>> condition)
    • clickOnElemBy

      public void clickOnElemBy(org.openqa.selenium.By locator)
    • sendKeysBy

      public void sendKeysBy(org.openqa.selenium.By locator, String value)
    • 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

      public <T> T executeJS(String script)
      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

      public <T> T executeJS(String script, boolean enableLog)
      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:
      close in interface AutoCloseable
    • getConfig

      public RpaDriverConfig getConfig()
    • getDriver

      public org.openqa.selenium.WebDriver getDriver()
    • getActions

      public org.openqa.selenium.interactions.Actions getActions()