Package com.magenic.jmaqs.appium
Class AppiumUtilities
java.lang.Object
com.magenic.jmaqs.appium.AppiumUtilities
public class AppiumUtilities
extends java.lang.Object
Appium Utilities class.
-
Method Summary
Modifier and Type Method Description static booleancaptureScreenshot(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver, AppiumTestObject testObject)To capture a screenshot during execution.static booleancaptureScreenshot(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver, AppiumTestObject testObject, java.lang.String appendName)To capture a screenshot during execution.static java.lang.StringcaptureScreenshot(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver, AppiumTestObject testObject, java.lang.String directory, java.lang.String fileNameWithoutExtension)To capture a screenshot during execution.static voidkillDriver(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver)Make sure the driver is shut down.static booleansavePageSource(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver, AppiumTestObject testObject)To capture a page source during execution.static booleansavePageSource(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver, AppiumTestObject testObject, java.lang.String appendName)To capture a page source during execution.static java.lang.StringsavePageSource(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver, AppiumTestObject testObject, java.lang.String directory, java.lang.String fileNameWithoutExtension)To capture Page Source during execution.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Method Details
-
captureScreenshot
public static boolean captureScreenshot(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver, AppiumTestObject testObject)To capture a screenshot during execution. Default parameter appendName of empty string.- Parameters:
appiumDriver- The Appium DrivertestObject- The Test Object to associate the screenshot.- Returns:
- True if the image was saved successfully, otherwise false.
-
captureScreenshot
public static boolean captureScreenshot(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver, AppiumTestObject testObject, java.lang.String appendName)To capture a screenshot during execution.- Parameters:
appiumDriver- The Appium DrivertestObject- The Test Object to associate the screenshot.appendName- The Name to append- Returns:
- True if the image was saved successfully, otherwise false.
-
captureScreenshot
public static java.lang.String captureScreenshot(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver, AppiumTestObject testObject, java.lang.String directory, java.lang.String fileNameWithoutExtension)To capture a screenshot during execution.- Parameters:
appiumDriver- The Appium DrivertestObject- The Test Object to associate the screenshot.directory- The directory file pathfileNameWithoutExtension- File Name Without Extension- Returns:
- Path to Screenshot.
-
savePageSource
public static boolean savePageSource(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver, AppiumTestObject testObject)To capture a page source during execution. Default parameter appendName of empty string.- Parameters:
appiumDriver- The Appium DrivertestObject- The Appium Test Object- Returns:
- True if saving page source is successful, otherwise false
-
savePageSource
public static boolean savePageSource(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver, AppiumTestObject testObject, java.lang.String appendName)To capture a page source during execution.- Parameters:
appiumDriver- The Appium DrivertestObject- The Appium Test ObjectappendName- Appends a name to the end of a filename- Returns:
- True if saving page source is successful, otherwise false
-
savePageSource
public static java.lang.String savePageSource(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver, AppiumTestObject testObject, java.lang.String directory, java.lang.String fileNameWithoutExtension)To capture Page Source during execution.- Parameters:
appiumDriver- The Appium DrivertestObject- The Appium Test Objectdirectory- The directory file pathfileNameWithoutExtension- File Name Without Extension- Returns:
- Path to the log file
-
killDriver
public static void killDriver(io.appium.java_client.AppiumDriver<org.openqa.selenium.WebElement> appiumDriver)Make sure the driver is shut down.- Parameters:
appiumDriver- The Appium Driver
-