Skip to main content

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');");

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));