Package core.helpers

Class ElementHelper


  • public class ElementHelper
    extends Object
    app page is parent class of different apps
    Author:
    ehsan matean
    • Constructor Detail

      • ElementHelper

        public ElementHelper()
    • 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: