DriverActions
Static methodsâ
withDriverâ
This will return IDriverActions which will expose different methods to handle all other driver actions.
IDriverActions driverActions = DriverActions.withDriver ();
Instance methodsâ
executeScript (script, args[])â
This method will execute the JS script and returns the result.
import static io.github.boykaframework.actions.drivers.DriverActions.withDriver;
. . .
String output = withDriver ().executeScript ("alert('Hello World');");
pressKeys (keys)â
This method will simulate the given keys being pressed.
import static io.github.boykaframework.actions.drivers.DriverActions.withDriver;
import org.openqa.selenium.Keys;
withDriver ().pressKeys (Keys.CONTROL, "v");
pauseâ
This method is used to navigate to the given URL.
import static io.github.boykaframework.actions.drivers.DriverActions.withDriver;
import static java.time.Duration.ofMillis;
. . .
withDriver ().pause (ofMillis (100));
saveLogsâ
This method will save all the logs captured by the Driver.
import static io.github.boykaframework.actions.drivers.DriverActions.withDriver;
. . .
withDriver ().saveLogs ();
waitUntilâ
This method will wait for any given condition to be true. It takes in Selenium WebDrivers ExpectedCondition<Boolean> object as parameter.
import static io.github.boykaframework.actions.drivers.DriverActions.withDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
. . .
withDriver ().waitUntil (ExpectedConditions.urlMatches (URL));
waitUntil(condition, timeout)â
This method will wait for any given condition to be true. It takes in Selenium WebDrivers ExpectedCondition<Boolean> object as parameter.
import static io.github.boykaframework.actions.drivers.DriverActions.withDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import java.time.Duration;
. . .
withDriver ().waitUntil (ExpectedConditions.urlMatches (URL), Duration.ofSeconds(10));