Class PageObjectUtil


  • public class PageObjectUtil
    extends Object
    Author:
    Madhav Krishna
    • Method Detail

      • getPageObjectInfo

        public static PageObjectInfo getPageObjectInfo​(String pageObject)
        Page object should be specified using the format. When POs are in ./src/main/page_objects/ directory: ".{maxTimeToWaitInSeconds: 10, params: {p1: 'v1', p2: '${variable1}'} }" When POs are in sub directory of ./src/main/page_objects/ directory: ".. PO in JSON format: {name: ".", maxTimeToWaitInSeconds: 4, params: {p1: 'v1', p2: 'v2'} }
        Parameters:
        pageObject -
        Returns:
      • prepareParamValue

        public static String prepareParamValue​(String paramValue,
                                               SmartCucumberScenarioContext scenarioContext)
        paramValue may contain the variable like ${variableName} and this variable value should be extracted from scenarioContext.
        Parameters:
        paramValue -
        scenarioContext -
        Returns:
      • setJavascriptParamValueOfElement

        public static Object setJavascriptParamValueOfElement​(SmartAppDriver appDriver,
                                                              org.openqa.selenium.WebElement element,
                                                              String paramName,
                                                              String value)
      • executeJavascriptFunctionOfElement

        public static Object executeJavascriptFunctionOfElement​(SmartAppDriver appDriver,
                                                                org.openqa.selenium.WebElement element,
                                                                String functionWithArgs)
      • prepareKeysChord

        public static String[] prepareKeysChord​(List<String> keyList)
      • findSeleniumKeysByName

        public static org.openqa.selenium.Keys findSeleniumKeysByName​(String keyName)