Class ElementOption
- java.lang.Object
-
- io.appium.java_client.touch.ActionOptions<T>
-
- io.appium.java_client.touch.offset.PointOption<ElementOption>
-
- io.appium.java_client.touch.offset.ElementOption
-
public class ElementOption extends PointOption<ElementOption>
-
-
Field Summary
-
Fields inherited from class io.appium.java_client.touch.offset.PointOption
coordinates
-
-
Constructor Summary
Constructors Constructor Description ElementOption()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Object>build()Creates a map based on the provided options.static ElementOptionelement(org.openqa.selenium.WebElement element)This method creates a build instance of theElementOption.static ElementOptionelement(org.openqa.selenium.WebElement element, int x, int y)This method creates a build instance of theElementOption.static ElementOptionelement(org.openqa.selenium.WebElement element, org.openqa.selenium.Point offset)This method creates a build instance of theElementOption.protected voidverify()This method is automatically called before building options map to verify the consistency of the instance.ElementOptionwithCoordinates(int xOffset, int yOffset)It defines x and y offset from the upper left corner of an element.ElementOptionwithCoordinates(org.openqa.selenium.Point offset)It defines x and y offset from the upper left corner of an element.ElementOptionwithElement(org.openqa.selenium.WebElement element)This method sets the element as an option.-
Methods inherited from class io.appium.java_client.touch.offset.PointOption
point, point
-
-
-
-
Method Detail
-
element
public static ElementOption element(org.openqa.selenium.WebElement element, org.openqa.selenium.Point offset)
This method creates a build instance of theElementOption.- Parameters:
element- is the element to calculate offset from.offset- is the offset from the upper left corner of the given element.- Returns:
- the built option
-
element
public static ElementOption element(org.openqa.selenium.WebElement element, int x, int y)
This method creates a build instance of theElementOption.- Parameters:
element- is the element to calculate offset from.x- is the x-offset from the upper left corner of the given element.y- is the y-offset from the upper left corner of the given element.- Returns:
- the built option
-
element
public static ElementOption element(org.openqa.selenium.WebElement element)
This method creates a build instance of theElementOption.- Parameters:
element- is the element to calculate offset from.- Returns:
- the built option
-
withCoordinates
public ElementOption withCoordinates(org.openqa.selenium.Point offset)
It defines x and y offset from the upper left corner of an element.- Overrides:
withCoordinatesin classPointOption<ElementOption>- Parameters:
offset- is the offset from the upper left corner of the given element.- Returns:
- self-reference
-
withCoordinates
public ElementOption withCoordinates(int xOffset, int yOffset)
It defines x and y offset from the upper left corner of an element.- Overrides:
withCoordinatesin classPointOption<ElementOption>- Parameters:
xOffset- is the x-offset from the upper left corner of the given element.yOffset- is the y-offset from the upper left corner of the given element.- Returns:
- self-reference
-
withElement
public ElementOption withElement(org.openqa.selenium.WebElement element)
This method sets the element as an option. It means that x/y offset is the offset from the upper left corner of the given element.- Parameters:
element- is the element to calculate offset from.- Returns:
- self-reference
-
verify
protected void verify()
Description copied from class:ActionOptionsThis method is automatically called before building options map to verify the consistency of the instance.- Overrides:
verifyin classPointOption<ElementOption>
-
build
public java.util.Map<java.lang.String,java.lang.Object> build()
Description copied from class:ActionOptionsCreates a map based on the provided options.- Overrides:
buildin classPointOption<ElementOption>- Returns:
- options mapping.
-
-