Package core.helpers
Class ElementHelper
- java.lang.Object
-
- core.helpers.ElementHelper
-
public class ElementHelper extends Object
app page is parent class of different apps- Author:
- ehsan matean
-
-
Constructor Summary
Constructors Constructor Description ElementHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int[]findMiddleOfElement(EnhancedBy target)returns the center coordinates of the target elementstatic StringgetAttribute(EnhancedBy byValue, int index, String attribute)gets specified attribute of the element based on indexstatic StringgetAttribute(EnhancedBy byValue, String attribute)gets specified attribute of the elementstatic org.openqa.selenium.PointgetElementPosition(EnhancedBy by)get element position on displaystatic org.openqa.selenium.PointgetElementPosition(EnhancedBy by, int index)get element position on displaystatic org.openqa.selenium.DimensiongetElementSize(EnhancedBy by)returns element dimensionstatic booleanisAttributeContaining(EnhancedBy by, String attribute, String value)returns true if element contains class valuestatic booleanisElementContainingClass(EnhancedBy by, String value)static voidsetAttribute(EnhancedBy by, int index, String attribute, String value)sets attribute value of an elementstatic voidsetAttribute(EnhancedBy by, String attribute, String value)sets attribute value of an element
-
-
-
Method Detail
-
getAttribute
public static String getAttribute(EnhancedBy byValue, String attribute)
gets specified attribute of the element- Parameters:
byValue-index-attribute-
-
getAttribute
public static String getAttribute(EnhancedBy byValue, int index, String attribute)
gets specified attribute of the element based on index- Parameters:
byValue-index-attribute-
-
isElementContainingClass
public static boolean isElementContainingClass(EnhancedBy by, String value)
-
isAttributeContaining
public static boolean isAttributeContaining(EnhancedBy by, String attribute, String value)
returns true if element contains class value- Parameters:
by-classValue-- Returns:
-
setAttribute
public static void setAttribute(EnhancedBy by, String attribute, String value)
sets attribute value of an element- Parameters:
by-attribute-value-
-
setAttribute
public static void setAttribute(EnhancedBy by, int index, String attribute, String value)
sets attribute value of an element- Parameters:
by-index-attribute-value-
-
getElementSize
public static org.openqa.selenium.Dimension getElementSize(EnhancedBy by)
returns element dimension- Parameters:
by-- Returns:
-
getElementPosition
public static org.openqa.selenium.Point getElementPosition(EnhancedBy by)
get element position on display- Parameters:
by-- Returns:
-
getElementPosition
public static org.openqa.selenium.Point getElementPosition(EnhancedBy by, int index)
get element position on display- Parameters:
by-index-- Returns:
-
findMiddleOfElement
public static int[] findMiddleOfElement(EnhancedBy target)
returns the center coordinates of the target element- Parameters:
target-- Returns:
-
-