public class Helper extends Helper
| Modifier and Type | Field and Description |
|---|---|
static ClickHelper |
click |
static ClickHelperAction |
clickAction |
static ClickHelperJs |
clickJs |
static CsvHelper |
csv |
static DateHelper |
date |
static FormHelper |
form |
static ImageProcessingHelper |
image |
static ListHelper |
list |
static Loginbuilder |
loginbuilder |
static MobileHelper |
mobile |
static PageHelper |
page |
static VerifyHelper |
verify |
static WaitHelper |
wait |
| Constructor and Description |
|---|
Helper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
acceptAlert()
accepts alert by selecting ok or cancel
|
static void |
addFileToZip(String path,
String srcFile,
ZipOutputStream zip) |
static void |
appendToFile(String value,
String absolutePath)
appends to existing file
|
static void |
appendToFile(String value,
String directory,
String filename,
String type)
appends to existing file
|
static void |
assertContains(String expected,
String actual)
assert actual contains expected
|
static void |
assertEquals(boolean expected,
boolean actual)
assert expected equals actual
|
static void |
assertEquals(int expected,
int actual)
assert expected equals actual
|
static void |
assertEquals(String expected,
String actual)
assert expected equals actual
|
static void |
assertFalse(String message) |
static void |
assertTrue(String message,
boolean value)
assert true
|
static void |
bringPageToFront()
brings current browser to front
|
static EnhancedBy |
byAccessibility(String element,
String name)
gets element by accessibility id
|
static EnhancedBy |
byCss(String element,
String name)
gets element by css value
|
static EnhancedBy |
byId(String element,
String name)
gets element by id
|
static EnhancedBy |
byXpath(String element,
String name)
gets element by xpath
|
static void |
captureExtentReportScreenshot()
captures screenshot And attaches to extent test report
|
static void |
clearAndSetField(EnhancedBy field,
CharSequence... value)
sets field clears field before setting the value
|
static void |
clearAndSetField(EnhancedBy field,
int index,
CharSequence... value)
sets field clears field before setting the value
|
static void |
clearAndSetField(org.openqa.selenium.WebElement field,
CharSequence... value)
sets field clears field before setting the value
|
static void |
clearAndSetField(org.openqa.selenium.WebElement field,
int index,
CharSequence... value)
sets field clears field before setting the value
|
static void |
clickAndExpect(EnhancedBy target,
EnhancedBy expected)
clicks target And waits for expected element to display retries 10 times
|
static void |
clickAndExpect(EnhancedBy target,
EnhancedBy expected,
boolean isMobileRefresh)
clicks target And waits for expected element to display retries 10 times
|
static void |
clickAndExpect(EnhancedBy target,
EnhancedBy expected,
EnhancedBy spinner)
clicks target And waits for expected element to show up also waits for
spinner element to be removed from display
|
static void |
clickAndExpect(EnhancedBy target,
int index,
EnhancedBy expected)
clicks element based on index And waits for expected element to be displayed
|
static void |
clickAndExpect(EnhancedBy target,
int index,
EnhancedBy expected1,
EnhancedBy expected2)
clicks target And wait for one the 2 expected elements to appear
|
static void |
clickAndExpect(EnhancedBy target,
String text,
EnhancedBy expected)
click And expect based on the text value on the element.
|
static void |
clickAndExpect(org.openqa.selenium.WebElement target,
int index,
org.openqa.selenium.WebElement expected)
clicks element based on index And waits for expected element to be displayed
|
static void |
clickAndExpect(org.openqa.selenium.WebElement target,
int index,
org.openqa.selenium.WebElement expected1,
org.openqa.selenium.WebElement expected2)
clicks target And wait for one the 2 expected elements to appear
|
static void |
clickAndExpect(org.openqa.selenium.WebElement target,
String text,
org.openqa.selenium.WebElement expected)
click And expect based on the text value on the element.
|
static void |
clickAndExpect(org.openqa.selenium.WebElement target,
org.openqa.selenium.WebElement expected)
clicks target And waits for expected element to display retries 10 times
|
static void |
clickAndExpect(org.openqa.selenium.WebElement target,
org.openqa.selenium.WebElement expected,
boolean isMobileRefresh)
clicks target And waits for expected element to display retries 10 times
|
static void |
clickAndExpect(org.openqa.selenium.WebElement target,
org.openqa.selenium.WebElement expected,
org.openqa.selenium.WebElement spinner)
clicks target And waits for expected element to show up also waits for
spinner element to be removed from display
|
void |
clickAndExpectContainsByText(EnhancedBy target,
String text,
EnhancedBy expected)
click And expect based on the text value on the element.
|
void |
clickAndExpectContainsByText(org.openqa.selenium.WebElement target,
String text,
org.openqa.selenium.WebElement expected)
click And expect based on the text value on the element.
|
static void |
clickAndHold(EnhancedBy target,
double seconds)
click And hold element
|
static void |
clickAndHold(EnhancedBy target,
int index,
double seconds)
click And hold based on element index
|
static void |
clickAndHold(org.openqa.selenium.WebElement target,
double seconds)
click And hold element
|
static void |
clickAndHold(org.openqa.selenium.WebElement target,
int index,
double seconds)
click And hold based on element index
|
static void |
clickAndNotExpect(EnhancedBy target,
EnhancedBy expected)
clicks target And waits for expected to not be displayed retries 10 times
|
static void |
clickAndNotExpect(EnhancedBy target,
int index,
EnhancedBy expected) |
static void |
clickAndNotExpect(org.openqa.selenium.WebElement target,
int index,
org.openqa.selenium.WebElement expected) |
static void |
clickAndNotExpect(org.openqa.selenium.WebElement target,
org.openqa.selenium.WebElement expected)
clicks target And waits for expected to not be displayed retries 10 times
|
static void |
clickAndWait(EnhancedBy target,
double timeInSeconds)
clicks target And waits for seconds
|
static void |
clickAndWait(EnhancedBy target,
int index,
double timeInSeconds)
clicks target And waits for seconds
|
static void |
clickAndWait(org.openqa.selenium.WebElement target,
double timeInSeconds)
clicks target And waits for seconds
|
static void |
clickAndWait(org.openqa.selenium.WebElement target,
int index,
double timeInSeconds)
clicks target And waits for seconds
|
static void |
clickElementContinsByText(EnhancedBy by,
String text)
click element with text containing
|
static void |
clickElementContinsByText(org.openqa.selenium.WebElement target,
String text)
click element with text containing
|
static void |
clickElementLocationBy(EnhancedBy by,
int x,
int y)
Click on an element's specific x,y location
|
static void |
clickElementLocationBy(org.openqa.selenium.WebElement target,
int x,
int y)
Click on an element's specific x,y location
|
static void |
clickPoints(int x,
int y)
click at position x, y
|
static void |
clickPointsAndExpect(int x,
int y,
EnhancedBy expected)
click point at x,y coordinates and expect and element to be present retry
every 5 seconds for duration of explicit timeout
|
static void |
clickPointsAndExpect(int x,
int y,
org.openqa.selenium.WebElement expected)
click point at x,y coordinates and expect and element to be present retry
every 5 seconds for duration of explicit timeout
|
static void |
CloseAndReturn(String defaultWindow)
close the window And return to the defaultWindow
|
static String |
convertListToString(ArrayList<String> list)
convert array list to string separated by ","
|
static String |
convertListToString(ArrayList<String> list,
String separator)
convert array list to string separated by ","
|
static URL |
convertToUrl(String url)
converts url string to url object
|
static void |
copyDirectory(String dirFrom,
String dirTo)
Copies directory And all content from dirFrom to dirTo overwrites the content
|
static File |
createFileFromPath(String absolutePath)
create directories and files based on absolute path
|
static ZipOutputStream |
createZip(String destZipFile) |
static String |
currentWindow()
return the current window handle
|
static void |
deleteAllCookies()
delete all cookies
|
static void |
deleteCookieNamed(String name)
delete cookie named
|
static void |
deleteFile(String absolutePath)
delete file
|
static String |
dimissAlert()
dismisses alert by selecting ok or cancel return alert message
|
static void |
doubleClick(EnhancedBy target,
int index)
double click on element
|
static void |
doubleClick(org.openqa.selenium.WebElement target,
int index)
double click on element
|
static void |
doubleClickBy(EnhancedBy by) |
static void |
doubleClickBy(org.openqa.selenium.WebElement element) |
static void |
doubleClickPoints(int x,
int y)
double click at position
|
static void |
dragAndDrop(EnhancedBy src,
EnhancedBy target)
drag And drop from src element to target element
|
void |
dragAndDrop(EnhancedBy srcParent,
int srcParentIndex,
EnhancedBy srcChild,
int scrChildIndex,
EnhancedBy targetParent,
int targeParenttIndex,
EnhancedBy targetChild,
int targetChildIndex)
drag And drop from src element to target element
|
static void |
dragAndDrop(EnhancedBy src,
int xOffset,
int yOffset)
drag And drop from src element to target element
|
static void |
dragAndDrop(org.openqa.selenium.WebElement src,
int xOffset,
int yOffset)
drag And drop from src element to target element
|
void |
dragAndDrop(org.openqa.selenium.WebElement srcParent,
int srcParentIndex,
org.openqa.selenium.WebElement srcChild,
int scrChildIndex,
org.openqa.selenium.WebElement targetParent,
int targeParenttIndex,
org.openqa.selenium.WebElement targetChild,
int targetChildIndex)
drag And drop from src element to target element
|
static void |
dragAndDrop(org.openqa.selenium.WebElement src,
org.openqa.selenium.WebElement target)
drag And drop from src element to target element
|
static String |
excel_getCellData(ExcelObject excel)
This method is to read the test data from the Excel cell, in this we are
passing parameters as Row num And Col num
|
static List<String> |
excel_getColumData(ExcelObject excel)
returns all the column data as array list of string
|
static void |
excel_setCellData(ExcelObject excel)
This method is to write in the Excel cell, Row num And Col num are the
parameters
|
static void |
excel_setCellData(List<ExcelObject> excelObjects) |
static ExcelObject |
excel_setExcelFile(ExcelObject excel)
gets the excel file And the work sheet
|
static ArrayList<String> |
executeCommand(String command)
run command and return results as array list will run bash on linux or mac
will run batch command on windows
|
static ArrayList<String> |
executeCommandFromFile(String filePath)
run script file and return results as array list will run bash on linux or
mac will run batch command on windows
|
static Object |
executeJs(String script,
Object... args)
execute javascript
|
static List<String> |
executeJsWithListReturn(String script,
Object... args)
execute javascript
|
static String |
executeJsWithStringReturn(String script,
Object... args)
execute javascript
|
static int[] |
findElementCoordinates(EnhancedBy target)
returns the center coordinates of the target element
|
static int[] |
findElementCoordinates(org.openqa.selenium.WebElement target)
returns the center coordinates of the target element
|
protected static EnhancedWebElement |
findElements(org.openqa.selenium.WebElement element)
finds list of elements
|
protected static EnhancedWebElement |
findElements(org.openqa.selenium.WebElement parent,
int parentIndex,
org.openqa.selenium.WebElement child)
finds a list of elements based on parent element
|
protected static EnhancedWebElement |
findElements(org.openqa.selenium.WebElement parent,
org.openqa.selenium.WebElement child)
finds element based on parent element
|
static int[] |
findMiddleOfElement(EnhancedBy target)
returns the center coordinates of the target element
|
static int[] |
findMiddleOfElement(org.openqa.selenium.WebElement target)
returns the center coordinates of the target element
|
static void |
formSubmit(EnhancedBy button,
EnhancedBy expected)
select submit button And wait for expected element to load
|
static void |
formSubmit(EnhancedBy button,
EnhancedBy expected,
EnhancedBy spinner)
clicks submit button, wait for element to appear And loading spinner to be
removed
|
static void |
formSubmit(org.openqa.selenium.WebElement button,
org.openqa.selenium.WebElement expected)
select submit button And wait for expected element to load
|
static void |
formSubmit(org.openqa.selenium.WebElement button,
org.openqa.selenium.WebElement expected,
org.openqa.selenium.WebElement spinner)
clicks submit button, wait for element to appear And loading spinner to be
removed
|
static String |
generateRandomInteger(int len)
generates random int of length len
|
static int |
generateRandomNumber(int min,
int max)
generates random number between two numbers, min, max
|
static String |
generateRandomString(int len)
generates random string of length len
|
static String |
generateUUID()
generate uuid
|
static String |
generateUUID(boolean includeDash)
generate uuid
|
static String |
generateUUID(int length)
generate uuid
|
static String |
generateUUID(int length,
boolean includeDash)
generate uuid
|
static String |
getAlertValue()
returns alert message value
|
static List<String> |
getAllValuesStartringWith(String source,
String value)
gets a list of string from 'source' starting with 'value'
|
static io.appium.java_client.android.AndroidDriver |
getAndroidDriver() |
static String |
getAttribute(EnhancedBy byValue,
int index,
String attribute)
gets specified attribute of the element based on index
|
static String |
getAttribute(EnhancedBy byValue,
String attribute)
gets specified attribute of the element
|
static String |
getAttribute(org.openqa.selenium.WebElement element,
int index,
String attribute)
gets specified attribute of the element based on index
|
static String |
getAttribute(org.openqa.selenium.WebElement byValue,
String attribute)
gets specified attribute of the element
|
static String |
getClipboardData()
retrieves the clip board data
|
static String |
getCurrentUrl()
returns the current url
|
static double |
getDoubleFromString(String value)
get int value from string
|
static double |
getDoubleFromString(String value,
boolean isFailOnNoInt)
get numeric value from string
|
static int |
getElementIndexContainByText(EnhancedBy listValue,
String option)
retuns index of element in list which contains in text
|
static int |
getElementIndexContainByText(org.openqa.selenium.WebElement listValue,
String option)
retuns index of element in list which contains in text
|
static int |
getElementIndexEqualsByText(EnhancedBy listValue,
String option)
returns the index of text value in a list
|
static int |
getElementIndexEqualsByText(org.openqa.selenium.WebElement listValue,
String option)
returns the index of text value in a list
|
static int |
getElementIndexInList(EnhancedBy srcList,
EnhancedBy target)
find the index of the target element in list eg.
|
static int |
getElementIndexInList(org.openqa.selenium.WebElement srcList,
org.openqa.selenium.WebElement target)
find the index of the target element in list eg.
|
static org.openqa.selenium.Point |
getElementPosition(EnhancedBy by)
get element position on display
|
static org.openqa.selenium.Point |
getElementPosition(EnhancedBy by,
int index)
get element position on display
|
static org.openqa.selenium.Point |
getElementPosition(org.openqa.selenium.WebElement element)
get element position on display
|
static org.openqa.selenium.Point |
getElementPosition(org.openqa.selenium.WebElement element,
int index)
get element position on display
|
static org.openqa.selenium.Dimension |
getElementSize(EnhancedBy by)
returns element dimension
|
static org.openqa.selenium.Dimension |
getElementSize(org.openqa.selenium.WebElement element)
returns element dimension
|
static File |
getFile(String directoryPath)
get file from file path
|
static File |
getFileByName(String path,
String filename)
get file by name
|
static File |
getFileByName(String path,
String filename,
boolean includeSubDir)
get file by name
|
static String |
getFileContent(String absolutePath)
gets file content as String
|
static String |
getFileContent(String absolutePath,
boolean verifyFileExists)
gets file content as String
|
static ArrayList<File> |
getFileList(String directoryPath)
returns the list of files in directory
|
static ArrayList<File> |
getFileList(String directoryPath,
boolean includeSubDir)
returns the list of files in directory
|
static ArrayList<File> |
getFileListByType(String directoryPath,
String type)
gets the list of files
|
static ArrayList<File> |
getFileListByType(String directoryPath,
String type,
boolean includeSubtype)
gets the list of files
|
static List<File> |
getFileListWithSubfolders(String directoryName,
List<File> files)
gets list of files including from sub folder based on type.
|
static List<File> |
getFileListWithSubfolders(String directoryName,
String type,
List<File> files)
gets list of files including from sub folder based on type.
|
static int |
getFirstNumber(String value) |
static String |
getFullPath(String path)
gets full path from relative path
relative path is from root directory ( where pom.xml file is located )
|
static int |
getIntFromString(String value)
get numeric value from string
|
static int |
getIntFromString(String value,
boolean isFailOnNoInt)
get numeric value from string
|
static io.appium.java_client.ios.IOSDriver |
getiOSDriver() |
static List<String> |
getLinesInFileContainingWith(String value,
File file)
get line in file containing string
|
static List<String> |
getLinesInFileStartingWith(String value,
File file)
get line in file starting with string
|
static int |
getListCount(EnhancedBy listValue)
returns the number of elements in list
|
static int |
getListCount(org.openqa.selenium.WebElement listValue)
returns the number of elements in list
|
static List<String> |
getListValues(EnhancedBy listValue)
returns the list of values in a list
|
static List<String> |
getListValues(org.openqa.selenium.WebElement listValue)
returns the list of values in a list
|
static int |
getNumber(String value)
get numeric value from string
|
static String |
getPageSource()
gets page source
|
static String |
getPageTitle()
returns the title of the page
|
static String |
getRootDir()
get current directory
|
List<String> |
getRowValuesFromList(EnhancedBy srclist,
int index,
EnhancedBy rows)
returns the list of string values for a row of elements
|
List<String> |
getRowValuesFromList(org.openqa.selenium.WebElement srclist,
int index,
org.openqa.selenium.WebElement rows)
returns the list of string values for a row of elements
|
static int |
getStringIndexContainByText(List<String> stringList,
String option)
returns the index of string value in list of strings
|
static int |
getStringIndexEqualsByText(List<String> stringList,
String option)
returns the index of string value in list of strings
|
HashMap<String,List<String>> |
getTableMap(EnhancedBy columns,
EnhancedBy dataRows,
EnhancedBy dataCells)
gets hashmap representation of data column with row values
|
HashMap<String,List<String>> |
getTableMap(EnhancedBy columns,
EnhancedBy dataRows,
EnhancedBy dataCells,
int maxRows)
gets hashmap representation of data column with row values
|
HashMap<String,List<String>> |
getTableMap(EnhancedBy columns,
int columnInitialIndex,
EnhancedBy dataRows,
int rowInitialIndex,
EnhancedBy dataCells,
int maxRows)
gets hashmap representation of data column with row values
|
HashMap<String,List<String>> |
getTableMap(org.openqa.selenium.WebElement columns,
int columnInitialIndex,
org.openqa.selenium.WebElement dataRows,
int rowInitialIndex,
org.openqa.selenium.WebElement dataCells,
int maxRows)
gets hashmap representation of data column with row values
|
HashMap<String,List<String>> |
getTableMap(org.openqa.selenium.WebElement columns,
org.openqa.selenium.WebElement dataRows,
org.openqa.selenium.WebElement dataCells)
gets hashmap representation of data column with row values
|
HashMap<String,List<String>> |
getTableMap(org.openqa.selenium.WebElement columns,
org.openqa.selenium.WebElement dataRows,
org.openqa.selenium.WebElement dataCells,
int maxRows)
gets hashmap representation of data column with row values
|
static List<String> |
getTextList(EnhancedBy listValue)
returns the list of values in a list
|
static List<String> |
getTextList(org.openqa.selenium.WebElement listValue)
returns the list of values in a list
|
static String |
getTextValue(EnhancedBy element)
gets the text value from an element
|
static String |
getTextValue(EnhancedBy element,
int index)
gets the text value from an element
|
static String |
getTextValue(org.openqa.selenium.WebElement target)
gets the text value from an element
|
static String |
getTextValue(org.openqa.selenium.WebElement target,
int index)
gets the text value from an element
|
static void |
getUrl(String url)
navigate to a different url
|
static String |
getValueFromPattern(String str,
String pattern) |
static List<String> |
getValuesFromPattern(String str,
String pattern) |
static org.openqa.selenium.WebDriver |
getWebdriver()
get current webdriver
|
static void |
handleDifferentUser()
if single signin enabled, And new test user is different form previous,
shutdown webdriver And restart
|
static void |
highLightWebElement(EnhancedBy by,
int index)
highlights the web element use on clicks and send key elements
|
static void |
highLightWebElement(org.openqa.selenium.WebElement target,
int index)
highlights the web element use on clicks and send key elements
|
static void |
hoverBy(EnhancedBy by)
hover over element
|
static void |
hoverBy(EnhancedBy by,
int index)
hover over element
|
static void |
hoverBy(org.openqa.selenium.WebElement element)
hover over element
|
static void |
hoverBy(org.openqa.selenium.WebElement element,
int index)
hover over element
|
static void |
hoverPoints(int x,
int y)
Hover on the x,y points
|
void |
inputTextByAction(EnhancedBy by,
String text) |
void |
inputTextByAction(org.openqa.selenium.WebElement element,
String text) |
static boolean |
isAndroid()
is android driver
|
static boolean |
isAttributeContaining(EnhancedBy by,
String attribute,
String value)
returns true if element contains attribute value
|
static boolean |
isAttributeContaining(org.openqa.selenium.WebElement element,
String attribute,
String value)
returns true if element contains attribute value
|
static boolean |
isBoolean(String value)
returns if string is boolean
|
boolean |
isChrome() |
static boolean |
isContainedInList(EnhancedBy listValue,
String option)
return if element is contained in list
|
static boolean |
isContainedInList(org.openqa.selenium.WebElement listValue,
String option)
return if element is contained in list
|
static boolean |
isDisplayed(EnhancedBy element)
returns true if element is displayed
|
static boolean |
isDisplayed(org.openqa.selenium.WebElement target)
returns true if element is displayed
|
static boolean |
isElementContainingClass(EnhancedBy by,
String classValue)
returns true if element contains class value
|
static boolean |
isElementContainingClass(org.openqa.selenium.WebElement element,
String classValue)
returns true if element contains class value
|
static boolean |
isElementContainingText(EnhancedBy element,
String text)
returns true if element contains text
|
static boolean |
isElementContainingText(org.openqa.selenium.WebElement target,
String text)
returns true if element contains text
|
boolean |
isElementEditable(EnhancedBy element)
attempts to set text value on element, if not successful, then element is not editable
|
boolean |
isElementEditable(EnhancedBy element,
int index)
attempts to set text value on element, if not successful, then element is not editable
|
boolean |
isElementEditable(org.openqa.selenium.WebElement target)
attempts to set text value on element, if not successful, then element is not editable
|
boolean |
isElementEditable(org.openqa.selenium.WebElement target,
int index)
attempts to set text value on element, if not successful, then element is not editable
|
static boolean |
isExactMatchInList(EnhancedBy listValue,
String option)
return if element is an exact match in list
|
static boolean |
isExactMatchInList(org.openqa.selenium.WebElement listValue,
String option)
return if element is an exact match in list
|
static boolean |
isFileContainsString(String value,
File file)
does file contain the given text value
|
static boolean |
isFileContainString(String value,
File file)
does file contain the given text value
|
boolean |
isFirefox() |
static boolean |
isInternetExplorer()
returns true if browser is ie
|
static boolean |
isIOS()
is ios driver
|
static boolean |
isMac()
returns true if OS is mac
|
boolean |
isMicrosoftEdge() |
static boolean |
isNumeric(String value)
return if string is a number
|
static boolean |
isPresent(EnhancedBy element)
returns true if element is displayed
|
static boolean |
isPresent(org.openqa.selenium.WebElement target)
returns true if element is displayed
|
static boolean |
isProxyRequired(URL url)
get proxy state from proxy enabled config
values: true, false, auto
if auto is set, then through proxy detection, we set value to true or false
|
boolean |
isSafari() |
static boolean |
isStringContainNumber(String value)
does string have numeric value
|
static boolean |
isStringContainOnlyNumber(String value)
does string have only numeric value
|
static boolean |
isTextDisplayed(String text)
is text displayed on page
|
static boolean |
isUnix()
returns true if OS is unix or linux
|
static boolean |
isUrlAbleToConnect(URL source,
Proxy proxy)
check if able to connect to source url
|
static boolean |
isUUID(String value)
is the string value UDID
|
static Boolean |
isVisibleInViewport(EnhancedBy by)
returns true if the element is visible in the current page only for web
applications
|
static Boolean |
isVisibleInViewport(EnhancedBy by,
int index)
returns true if the element is visible in the current page only for web
applications
|
static Boolean |
isVisibleInViewport(org.openqa.selenium.WebElement element)
returns true if the element is visible in the current page only for web
applications
|
static Boolean |
isVisibleInViewport(org.openqa.selenium.WebElement element,
int index)
returns true if the element is visible in the current page only for web
applications
|
static boolean |
isWebDriver()
is web driver
|
static boolean |
isWindows()
returns true if OS is windows
|
static void |
killMacProcess(String serviceName)
returns kills the process if running
|
static void |
killWindowsProcess(String serviceName)
returns kills the process if running
|
static void |
localizationLoadJson(String fileName)
loads localization map from a json file to the test object data
|
static void |
localizationSetupCsv(String language)
sets the language for csv localization file
|
static String |
localize(String key)
gets local language from json file specified in properties file
|
static void |
logStackTrace(AssertionError e) |
static void |
logStackTrace(Exception e) |
static void |
maximizePage()
maximizes web page
|
Set<String> |
mobile_getContextList()
returns the list of mobile context.
|
static void |
mobile_hideKeyboard()
hides ios or android keyboard
|
static boolean |
mobile_isMobile()
returns if mobile driver is used
|
static void |
mobile_longPress(EnhancedBy target,
long miliSeconds)
press per retry presses the target element
|
static void |
mobile_longPress(org.openqa.selenium.WebElement target,
long miliSeconds)
press per retry presses the target element
|
static void |
mobile_longPressAndExpect(EnhancedBy target,
long miliSeconds,
EnhancedBy expected)
long press And expect element
|
static void |
mobile_longPressAndExpect(org.openqa.selenium.WebElement target,
long miliSeconds,
org.openqa.selenium.WebElement expected)
long press And expect element
|
static void |
mobile_resetApp()
resets the app
|
static void |
mobile_scrollToElement(EnhancedBy target)
scrolls to mobile element until element is becomes visible
|
static void |
mobile_scrollToElement(org.openqa.selenium.WebElement target)
scrolls to mobile element until element is becomes visible
|
static void |
mobile_setLocation(org.openqa.selenium.html5.Location location)
sets gps location on ios simulator
|
void |
mobile_swipeDown(double durationInSeconds)
swipe down on the screen
|
void |
mobile_swipeDown(EnhancedBy element,
int index,
double durationInSeconds)
swipe down on the screen based on element position
|
void |
mobile_swipeDown(org.openqa.selenium.WebElement element,
int index,
double durationInSeconds)
swipe down on the screen based on element position
|
void |
mobile_swipeLeft(double durationInSeconds)
swipe right on the screen
|
void |
mobile_swipeLeft(EnhancedBy element,
int index,
double durationInSeconds)
swipe left on the screen based on element position
|
void |
mobile_swipeLeft(org.openqa.selenium.WebElement element,
int index,
double durationInSeconds)
swipe left on the screen based on element position
|
void |
mobile_swipeRight(double durationInSeconds)
swipe right on the screen
|
void |
mobile_swipeRight(EnhancedBy element,
int index,
double durationInSeconds)
swipe right on the screen based on element position
|
void |
mobile_swipeRight(org.openqa.selenium.WebElement element,
int index,
double durationInSeconds)
swipe right on the screen based on element position
|
void |
mobile_swipeUp(double durationInSeconds)
swipe up on the screen
|
void |
mobile_swipeUp(EnhancedBy element,
int index,
double durationInSeconds)
swipe up on the screen based on element position
|
void |
mobile_swipeUp(org.openqa.selenium.WebElement element,
int index,
double durationInSeconds)
swipe up on the screen based on element position
|
static void |
mobile_switchToNativeView()
sets native context for android And ios apps
|
void |
mobile_switchToView(String view)
switch to view
|
static void |
mobile_switchToWebView()
sets web context for android And ios apps
|
static void |
mobile_waitAndRefreshForElementToLoad(EnhancedBy target)
waits for element to load And refreshes the app each time to renew the dom
|
static void |
mobile_waitAndRefreshForElementToLoad(EnhancedBy target,
int time)
waits for element to load And refreshes the app each time to renew the dom
|
static void |
mobile_waitAndRefreshForElementToLoad(org.openqa.selenium.WebElement target)
waits for element to load And refreshes the app each time to renew the dom
|
static void |
mobile_waitAndRefreshForElementToLoad(org.openqa.selenium.WebElement target,
int time)
waits for element to load And refreshes the app each time to renew the dom
|
static void |
mobile_zoomIn(EnhancedBy indicator)
zooms in And checks if target level indicator has been reached
|
static void |
mobile_zoomIn(int zoomLevel)
zoom in based on zoom levels.
|
static void |
mobile_zoomIn(org.openqa.selenium.WebElement indicator)
zooms in And checks if target level indicator has been reached
|
static void |
mobile_zoomOut(EnhancedBy indicator)
zooms out And checks if target level indicator has been reached
|
static void |
mobile_zoomOut(int zoomLevel)
zoom in based on zoom levels.
|
static void |
mobile_zoomOut(org.openqa.selenium.WebElement indicator)
zooms out And checks if target level indicator has been reached
|
static void |
moveToElement(EnhancedBy target,
int index)
move to element by using action
|
static void |
moveToElement(EnhancedBy target,
int index,
int xOffset,
int yOffset)
move to element by using action
|
static void |
moveToElement(org.openqa.selenium.WebElement target,
int index)
move to element by using action
|
static void |
moveToElement(org.openqa.selenium.WebElement target,
int index,
int xOffset,
int yOffset)
move to element by using action
|
static void |
navigateBack()
navigates back
|
static void |
navigateForward()
navigate forward
|
static void |
navigateToUrl(String url)
navigate to a different url
|
static void |
pressEnterOnAndroid()
select enter on android
|
static void |
printPageSource()
prints page source to console
|
static void |
quitAllCurrentTestDrivers()
quits all drivers in the current test
|
static void |
quitCurrentDriver()
quits the current web driver
|
static void |
quitDriver(org.openqa.selenium.WebDriver driver)
quit driver
|
static String |
readFileContent(String absolutePath)
gets file content as String
|
static void |
refreshMobileApp()
places the app in background And Then relaunches it
|
static void |
refreshPage()
reload page
|
static void |
refreshPageSource()
gets page source
|
static String |
removeSurroundingQuotes(String value)
remove surrounding double quotes from the string
|
static void |
rightClick(EnhancedBy target,
int index)
right click on element at index
|
static void |
rightClick(org.openqa.selenium.WebElement target,
int index)
right click on element at index
|
static void |
runApiContaining(String identifier,
String prefix,
String getApi,
String targetApiId,
String variable,
String targerApi)
runApiContaining("name", "zzz_","getCompanies",
"id","companyId","deleteCompany") get all companies with name containing
zzz_, Then gets id of these companies, stores them in companyId variable And
calls deleteCompany
|
static void |
runApiEquals(String identifier,
String value,
String getApi,
String targetApiId,
String variable,
String targerApi)
runApiEquals("name", "test123","getCompanies",
"id","companyId","deleteCompany") get all companies with name equals test123,
Then gets id of these companies And calls delete with id
|
static Object |
runInternalClass(String sourcePath,
String methodName,
List<KeyValue> parameterList)
runs method from external class
|
static void |
screenshotCapture() |
static void |
scrollBottomPageBrowser()
scroll to bottom of browser
|
static void |
scrollDown()
scrolls down android
|
static void |
scrollDownBrowser()
scroll down the browser
|
static void |
scrollDownBrowser(int count)
scroll down the browser
|
static void |
scrollToWebElement(EnhancedBy element)
scroll to web element
|
static void |
scrollToWebElement(EnhancedBy element,
int index)
scroll to element
|
static void |
scrollToWebElement(org.openqa.selenium.WebElement element)
scroll to web element
|
static void |
scrollToWebElement(org.openqa.selenium.WebElement element,
int index)
scroll to element
|
static void |
scrollUpBrowser()
scroll up the browser
|
static void |
scrollUpBrowser(int count)
scroll up the browser
|
static void |
searchAndWaitForResults(String searchQuery,
EnhancedBy byTarget,
EnhancedBy spinner)
enters value into the search field And selects enter waits for the loading
spinner to be removed
|
static void |
searchAndWaitForResults(String searchQuery,
org.openqa.selenium.WebElement target,
org.openqa.selenium.WebElement spinner)
enters value into the search field And selects enter waits for the loading
spinner to be removed
|
static void |
selectCheckBox(EnhancedBy button,
boolean isSelect)
selects checkbox based on by value
|
static void |
selectCheckBox(org.openqa.selenium.WebElement button,
boolean isSelect)
selects checkbox based on by value
|
static void |
selectDropDown(EnhancedBy field,
EnhancedBy item)
select drop down using by value of the list item
|
static void |
selectDropDown(EnhancedBy field,
EnhancedBy list,
String... options)
selects drop down
|
static void |
selectDropDown(int index,
EnhancedBy field,
EnhancedBy listValue)
select drop down by index from the drop down list
|
static void |
selectDropDown(int index,
org.openqa.selenium.WebElement field,
org.openqa.selenium.WebElement listValue)
select drop down by index from the drop down list
|
static void |
selectDropDown(String option,
EnhancedBy field,
EnhancedBy listValue)
Deprecated.
replaced by selectDropDown(field, list, options)
selects drop down
|
static void |
selectDropDown(String option,
EnhancedBy field,
EnhancedBy listValue,
int listIndex)
select drop down based on index of the drop down list eg.
|
static void |
selectDropDown(String option,
EnhancedBy field,
int index,
EnhancedBy listValue)
selects drop down based on index of the drop down field
|
static void |
selectDropDown(String option,
EnhancedBy field,
int index,
EnhancedBy list,
int listIndex)
select drop down based on index of the drop down list eg.
|
static void |
selectDropDown(String option,
EnhancedBy field,
String field_Identifier,
EnhancedBy listValue)
selects drop down from list defined by another list defined by text
|
static void |
selectDropDown(String option,
org.openqa.selenium.WebElement field,
int index,
org.openqa.selenium.WebElement listValue)
selects drop down based on index of the drop down field
|
static void |
selectDropDown(String option,
org.openqa.selenium.WebElement field,
int index,
org.openqa.selenium.WebElement list,
int listIndex)
select drop down based on index of the drop down list eg.
|
static void |
selectDropDown(String option,
org.openqa.selenium.WebElement field,
String field_Identifier,
org.openqa.selenium.WebElement listValue)
selects drop down from list defined by another list defined by text
|
static void |
selectDropDown(String option,
org.openqa.selenium.WebElement field,
org.openqa.selenium.WebElement listValue)
Deprecated.
replaced by selectDropDown(field, list, options)
selects drop down
|
static void |
selectDropDown(String option,
org.openqa.selenium.WebElement field,
org.openqa.selenium.WebElement listValue,
int listIndex)
select drop down based on index of the drop down list eg.
|
static void |
selectDropDown(org.openqa.selenium.WebElement field,
org.openqa.selenium.WebElement item)
select drop down using by value of the list item
|
static void |
selectDropDown(org.openqa.selenium.WebElement field,
org.openqa.selenium.WebElement list,
String... options)
selects drop down
|
static void |
selectDropDownWithDoubleClick(String option,
EnhancedBy field,
EnhancedBy listValue)
selects dropdown by double clicking on the field
|
static void |
selectDropDownWithDoubleClick(String option,
EnhancedBy field,
int index,
EnhancedBy listValue)
selects dropdown by double clicking on the field
|
static void |
selectDropDownWithDoubleClick(String option,
org.openqa.selenium.WebElement field,
int index,
org.openqa.selenium.WebElement listValue)
selects dropdown by double clicking on the field
|
static void |
selectDropDownWithDoubleClick(String option,
org.openqa.selenium.WebElement field,
org.openqa.selenium.WebElement listValue)
selects dropdown by double clicking on the field
|
static void |
selectElementContainedInList(EnhancedBy listValue,
String option,
EnhancedBy target)
Selects list item from a parent container eg.
|
static void |
selectElementContainedInList(EnhancedBy listValue,
String option,
EnhancedBy target,
int targetIndex)
Selects list item from a parent container eg.
|
static void |
selectElementContainedInList(org.openqa.selenium.WebElement listValue,
String option,
org.openqa.selenium.WebElement target)
Selects list item from a parent container eg.
|
static void |
selectElementContainedInList(org.openqa.selenium.WebElement listValue,
String option,
org.openqa.selenium.WebElement target,
int targetIndex)
Selects list item from a parent container eg.
|
static void |
selectElementInList(EnhancedBy listValue,
int index)
selects an element in list by its index value
|
static void |
selectElementInList(EnhancedBy listValue,
int index,
EnhancedBy expected)
selects an element in list by its index value And waits for expected element
|
static void |
selectElementInList(org.openqa.selenium.WebElement listValue,
int index)
selects an element in list by its index value
|
static void |
selectListItemByIndex(EnhancedBy listValue,
int index)
selects list item by the string option provided
|
static void |
selectListItemByIndex(org.openqa.selenium.WebElement listValue,
int index)
selects list item by the string option provided
|
static void |
selectListItemContainsByName(EnhancedBy listValue,
String option)
finds target element which is in the same container And has the same index as
the parent eg.
|
static void |
selectListItemContainsByName(EnhancedBy listValue,
String option,
EnhancedBy target)
selects list item containing string eg.
|
static void |
selectListItemContainsByName(org.openqa.selenium.WebElement listValue,
String option)
finds target element which is in the same container And has the same index as
the parent eg.
|
static void |
selectListItemContainsByName(org.openqa.selenium.WebElement listValue,
String option,
org.openqa.selenium.WebElement target)
selects list item containing string eg.
|
static void |
selectListItemEqualsByName(EnhancedBy listValue,
String option)
selects list item by the string option provided
|
static void |
selectListItemEqualsByName(EnhancedBy listValue,
String option,
EnhancedBy target)
finds target element which is in the same container And has the same index as
the parent eg.
|
static void |
selectListItemEqualsByName(org.openqa.selenium.WebElement listValue,
String option)
selects list item by the string option provided
|
static void |
selectListItemEqualsByName(org.openqa.selenium.WebElement listValue,
String option,
org.openqa.selenium.WebElement target)
finds target element which is in the same container And has the same index as
the parent eg.
|
static void |
selectMultipleCheckboxOptions(List<String> selections,
EnhancedBy checkboxes)
selects multiple checkbox options
|
static void |
selectMultipleCheckboxOptions(List<String> selections,
org.openqa.selenium.WebElement checkboxes)
selects multiple checkbox options
|
static void |
selectRadioButton(EnhancedBy button)
selects a button
|
static void |
selectRadioButton(String option,
EnhancedBy buttons)
selects radio button by radio button description
|
static void |
selectRadioButton(String option,
org.openqa.selenium.WebElement buttons)
selects radio button by radio button description
|
static void |
selectRadioButton(org.openqa.selenium.WebElement button)
selects a button
|
static void |
sendMail(EmailObject email)
sends email to recipient using email object
|
static void |
setAttribute(EnhancedBy by,
int index,
String attribute,
String value)
sets attribute value of an element
|
static void |
setAttribute(EnhancedBy by,
String attribute,
String value)
sets attribute value of an element
|
static void |
setAttribute(org.openqa.selenium.WebElement element,
int index,
String attribute,
String value)
sets attribute value of an element
|
static void |
setAttribute(org.openqa.selenium.WebElement element,
String attribute,
String value)
sets attribute value of an element
|
static void |
setChildField(EnhancedBy parent,
int parentIndex,
EnhancedBy child,
int childIndex,
CharSequence... value)
sets key based on nested text field
|
static void |
setChildField(org.openqa.selenium.WebElement parent,
int parentIndex,
org.openqa.selenium.WebElement child,
int childIndex,
CharSequence... value)
sets key based on nested text field
|
static void |
setDriver(org.openqa.selenium.WebDriver driver) |
static void |
setField(EnhancedBy field,
CharSequence... value)
set field value if value is not empty
|
static void |
setField(String value,
EnhancedBy field,
int index)
sets field text value by index hides keyboard if on ios device
|
static void |
setField(String value,
org.openqa.selenium.WebElement field,
int index)
sets field text value by index hides keyboard if on ios device
|
static void |
setField(org.openqa.selenium.WebElement field,
CharSequence... value)
set field value if value is not empty
|
static void |
setFieldAndEnter(EnhancedBy field,
CharSequence... value)
sets field And presses the enter key
|
static void |
setFieldAndEnter(org.openqa.selenium.WebElement field,
CharSequence... value)
sets field And presses the enter key
|
static void |
setFieldByAction(EnhancedBy field,
CharSequence... value) |
static void |
setFieldByAction(EnhancedBy field,
int index,
CharSequence... value) |
static void |
setFieldByAction(org.openqa.selenium.WebElement field,
CharSequence... value) |
static void |
setFieldByAction(org.openqa.selenium.WebElement field,
int index,
CharSequence... value) |
static void |
setFieldByJs(EnhancedBy field,
CharSequence... value) |
static void |
setFieldByJs(EnhancedBy field,
int index,
CharSequence... value) |
static void |
setFieldByJs(org.openqa.selenium.WebElement field,
CharSequence... value) |
static void |
setFieldByJs(org.openqa.selenium.WebElement field,
int index,
CharSequence... value) |
static void |
setKey(org.openqa.selenium.Keys key,
EnhancedBy field)
send
|
static void |
setKey(org.openqa.selenium.Keys key,
org.openqa.selenium.WebElement field)
send
|
static void |
setLegacyDriver(org.openqa.selenium.WebDriver driver) |
static void |
setLegacyDriver(org.openqa.selenium.WebDriver driver,
boolean isPropertyDisabled,
int timeoutSec,
int implicitSec) |
static void |
setPageSize(int x,
int y)
sets page size
|
static org.testng.asserts.SoftAssert |
softAssert() |
static void |
softAssertAll() |
static void |
softAssertEqual(int expected,
int actual) |
static void |
softAssertEqual(String expected,
String actual) |
static void |
softAssertTrue(String message,
boolean value) |
static StopWatchHelper |
start()
StopWatchHelper watch = Helper.start(); do something long passedTimeInMs =
watch.time(); long passedTimeInSeconds = watch.time(TimeUnit.SECONDS);
|
static String |
stringNormalize(String value)
normalizes string removes space, new line chars
|
static String |
stringRemoveLines(String value)
normalizes string removes space, new line chars
|
static void |
switchDriver(org.openqa.selenium.WebDriver driver)
switch webdriver use for switching between different drivers
|
static void |
switchIframe(EnhancedBy frame)
switches frame to frame specified
|
static void |
switchIframe(org.openqa.selenium.WebElement frame)
switches frame to frame specified
|
static void |
switchToDefaultFrame()
switches to default frame
|
static void |
switchToNewWindow(String defaultWindow)
switch to the new opened window
|
static void |
switchToNextTab()
switch to next tab
|
static void |
switchToPreviousTab()
switch to next tab circles back to initial tab if it reaches the last tab
|
static void |
switchToTab(int index)
switch to previous tab circle back to the last tab
|
static void |
swtichUrl(String url)
navigate to a different url
|
static void |
uploadFile(String location,
EnhancedBy imageButton)
uploads file by specifying file location relative to main path
|
static void |
uploadFile(String location,
org.openqa.selenium.WebElement imageButton)
uploads file by specifying file location relative to main path
|
static void |
uploadImage(String location,
EnhancedBy imageButton,
EnhancedBy images)
sets the image based on location
|
static void |
uploadImage(String location,
org.openqa.selenium.WebElement imageButton,
org.openqa.selenium.WebElement images)
sets the image based on location
|
static void |
uploadImages(List<String> locations,
EnhancedBy imageButton,
EnhancedBy images)
sets the image based on location
|
static void |
uploadImages(List<String> locations,
org.openqa.selenium.WebElement imageButton,
org.openqa.selenium.WebElement images)
sets the image based on location
|
static void |
verifyAnyText(EnhancedBy target,
String... values)
verifies if text contains any of values in list
|
static void |
verifyAnyText(org.openqa.selenium.WebElement target,
String... values)
verifies if text contains any of values in list
|
static void |
verifyAnyTextContaining(EnhancedBy target,
String... values)
verifies if text contains any of values in list
|
static void |
verifyAnyTextContaining(org.openqa.selenium.WebElement target,
String... values)
verifies if text contains any of values in list
|
static void |
verifyContainsIsInList(EnhancedBy listValue,
String option)
verifies if option value is in the list index = -1 indicates the value is not
in list
|
static void |
verifyContainsIsInList(org.openqa.selenium.WebElement listValue,
String option)
verifies if option value is in the list index = -1 indicates the value is not
in list
|
static void |
verifyElementContainingText(EnhancedBy element,
String text)
verify if element contains text
|
static void |
verifyElementContainingText(org.openqa.selenium.WebElement target,
String text)
verify if element contains text
|
static void |
verifyElementCount(EnhancedBy by,
int value,
int... correction)
verifies element count
|
static void |
verifyElementCount(org.openqa.selenium.WebElement target,
int value,
int... correction)
verifies element count
|
static void |
verifyElementIsDisplayed(EnhancedBy by)
verifies if element(s) is (are) displayed
|
static void |
verifyElementIsDisplayed(org.openqa.selenium.WebElement target)
verifies if element(s) is (are) displayed
|
static void |
verifyElementIsNotDisplayed(EnhancedBy by)
verifies if element(s) is (are) not displayed
|
static void |
verifyElementIsNotDisplayed(org.openqa.selenium.WebElement target)
verifies if element(s) is (are) not displayed
|
static void |
verifyElementText(EnhancedBy by,
String value)
verifies element text equals provided value
|
static void |
verifyElementText(org.openqa.selenium.WebElement target,
String value)
verifies element text equals provided value
|
static void |
verifyIsInList(EnhancedBy listValue,
String option)
verifies if option value is in the list index = -1 indicates the value is not
in list
|
static void |
verifyIsInList(EnhancedBy listValue,
String indicator,
String option)
verify text option in list based on key value in the list
|
static void |
verifyIsInList(org.openqa.selenium.WebElement listValue,
String option)
verifies if option value is in the list index = -1 indicates the value is not
in list
|
static void |
verifyIsInList(org.openqa.selenium.WebElement listValue,
String indicator,
String option)
verify text option in list based on key value in the list
|
static void |
verifyNumberOfTabs(int tabs)
switch to tab by index
|
static void |
verifyTextDisplayed(String text)
verify if text is displayed on page
|
static void |
verifyTitle(String appTitle)
verify page title
|
void |
verifyToolTip(EnhancedBy tooltip,
int index,
String text)
verify tool tip is displayed
|
void |
verifyToolTip(org.openqa.selenium.WebElement tooltip,
int index,
String text)
verify tool tip is displayed
|
static void |
waitForAdditionalElementsToLoad(EnhancedBy target,
int originalCount)
waits for element count to increase from the originalCount Usefull When
waiting for a list to expand with additional items
|
static void |
waitForAdditionalElementsToLoad(EnhancedBy target,
int originalCount,
int time)
waits for element count to increase from the originalCount Usefull When
waiting for a list to expand with additional items
|
static void |
waitForAdditionalElementsToLoad(org.openqa.selenium.WebElement target,
int originalCount)
waits for element count to increase from the originalCount Usefull When
waiting for a list to expand with additional items
|
static void |
waitForAdditionalElementsToLoad(org.openqa.selenium.WebElement target,
int originalCount,
int time)
waits for element count to increase from the originalCount Usefull When
waiting for a list to expand with additional items
|
static boolean |
waitForAnyTextToLoad(EnhancedBy target,
int time,
String... text)
wait for any text strings to become available
|
static boolean |
waitForAnyTextToLoad(EnhancedBy target,
String... text)
wait for any text strings to become available
|
static boolean |
waitForAnyTextToLoad(org.openqa.selenium.WebElement target,
int time,
String... text)
wait for any text strings to become available
|
static boolean |
waitForAnyTextToLoad(org.openqa.selenium.WebElement target,
String... text)
wait for any text strings to become available
|
static boolean |
waitForAnyTextToLoadContaining(EnhancedBy target,
int time,
String... text)
wait for any text strings to become available
|
static boolean |
waitForAnyTextToLoadContaining(EnhancedBy target,
String... text)
wait for any text strings to become available
|
static boolean |
waitForAnyTextToLoadContaining(org.openqa.selenium.WebElement target,
int time,
String... text)
wait for any text strings to become available
|
static boolean |
waitForAnyTextToLoadContaining(org.openqa.selenium.WebElement target,
String... text)
wait for any text strings to become available
|
boolean |
waitForClassContain(EnhancedBy target,
int index,
String value)
wait for class to contain
|
boolean |
waitForClassContain(EnhancedBy target,
int index,
String value,
int time)
wait for class to contain value
|
boolean |
waitForClassContain(org.openqa.selenium.WebElement target,
int index,
String value)
wait for class to contain
|
boolean |
waitForClassContain(org.openqa.selenium.WebElement target,
int index,
String value,
int time)
wait for class to contain value
|
static boolean |
waitForElementToBeClickable(EnhancedBy selector)
wait for element to become clickable causes instability with hybrid mobile
app
|
static boolean |
waitForElementToBeClickable(EnhancedBy selector,
int timeInSeconds)
wait for element to become clickable causes instability with hybrid mobile
app
|
static boolean |
waitForElementToBeClickable(org.openqa.selenium.WebElement selector)
wait for element to become clickable causes instability with hybrid mobile
app
|
static boolean |
waitForElementToBeClickable(org.openqa.selenium.WebElement selector,
int timeInSeconds)
wait for element to become clickable causes instability with hybrid mobile
app
|
static boolean |
waitForElementToBeRemoved(EnhancedBy target)
waits for element to not be displayed wait for maximum of 60 seconds
|
static boolean |
waitForElementToBeRemoved(EnhancedBy target,
int time)
waits for element to not be displayed
|
static boolean |
waitForElementToBeRemoved(EnhancedBy target,
int time,
int waitForTargetToLoadInSeconds)
waits for element to not be displayed
|
static boolean |
waitForElementToBeRemoved(org.openqa.selenium.WebElement target)
waits for element to not be displayed wait for maximum of 60 seconds
|
static boolean |
waitForElementToBeRemoved(org.openqa.selenium.WebElement target,
int time)
waits for element to not be displayed
|
static boolean |
waitForElementToBeRemoved(org.openqa.selenium.WebElement target,
int time,
int waitForTargetToLoadInSeconds)
waits for element to not be displayed
|
static void |
waitForElementToLoad(EnhancedBy target)
waits for element to be displayed for amount of time specified by 60 seconds
|
static boolean |
waitForElementToLoad(EnhancedBy target,
int time)
waits for element to load count() checks if the element is displayed Then
gets the count number
|
static boolean |
waitForElementToLoad(EnhancedBy target,
int time,
int count)
waits for element to load If mobile device, scrolls down the page until
element is visible
|
static void |
waitForElementToLoad(org.openqa.selenium.WebElement target)
waits for element to be displayed for amount of time specified by 60 seconds
|
static boolean |
waitForElementToLoad(org.openqa.selenium.WebElement target,
int time)
waits for element to load count() checks if the element is displayed Then
gets the count number
|
static boolean |
waitForElementToLoad(org.openqa.selenium.WebElement target,
int time,
int count)
waits for element to load If mobile device, scrolls down the page until
element is visible
|
static boolean |
waitForFirstElementToLoad(EnhancedBy element1,
EnhancedBy element2)
waits for either element to load returns true When first item loads
|
static boolean |
waitForFirstElementToLoad(EnhancedBy element1,
EnhancedBy element2,
EnhancedBy element3)
waits for either element to load returns true When first item loads
|
static boolean |
waitForFirstElementToLoad(EnhancedBy element1,
EnhancedBy element2,
EnhancedBy element3,
int time)
waits for either element to load returns true When first item loads
|
static boolean |
waitForFirstElementToLoad(EnhancedBy element1,
EnhancedBy element2,
int time)
waits for either element to load returns true When first item loads
|
static boolean |
waitForFirstElementToLoad(org.openqa.selenium.WebElement element1,
org.openqa.selenium.WebElement element2)
waits for either element to load returns true When first item loads
|
static boolean |
waitForFirstElementToLoad(org.openqa.selenium.WebElement element1,
org.openqa.selenium.WebElement element2,
int time)
waits for either element to load returns true When first item loads
|
static boolean |
waitForFirstElementToLoad(org.openqa.selenium.WebElement element1,
org.openqa.selenium.WebElement element2,
org.openqa.selenium.WebElement element3)
waits for either element to load returns true When first item loads
|
static boolean |
waitForFirstElementToLoad(org.openqa.selenium.WebElement element1,
org.openqa.selenium.WebElement element2,
org.openqa.selenium.WebElement element3,
int time)
waits for either element to load returns true When first item loads
|
static void |
waitForListItemToLoad_Contains(EnhancedBy list,
String option)
waits for item containing in list to load
|
static void |
waitForListItemToLoad_Contains(org.openqa.selenium.WebElement list,
String option)
waits for item containing in list to load
|
static void |
waitForPageToLoad()
waits for webpage to load
|
static void |
waitForSeconds(double seconds)
waits for number of seconds
|
static void |
waitForTextToLoad(EnhancedBy target,
int time,
String text)
make sure only one element And caller needs to take responsibility to have
text in the element
|
static void |
waitForTextToLoad(EnhancedBy target,
String text)
waits for text to be loaded for amount of time specified by 60 seconds
|
static void |
waitForTextToLoad(org.openqa.selenium.WebElement target,
int time,
String text)
make sure only one element And caller needs to take responsibility to have
text in the element
|
static void |
waitForTextToLoad(org.openqa.selenium.WebElement target,
String text)
waits for text to be loaded for amount of time specified by 60 seconds
|
static void |
writeFile(String value,
String absolutePath)
Create file (where pom.xml is) and write to it
|
static void |
writeFile(String value,
String path,
String filename,
String type)
Create file with path starting from root directory (where pom.xml is) and
write to it.
|
static ZipOutputStream |
zipFolder(String srcFolder,
String destZipFile)
zip folder
|
findElements, findElements, findElementspublic static ClickHelper click
public static WaitHelper wait
public static MobileHelper mobile
public static ListHelper list
public static PageHelper page
public static FormHelper form
public static ImageProcessingHelper image
public static DateHelper date
public static CsvHelper csv
public static Loginbuilder loginbuilder
public static VerifyHelper verify
public static ClickHelperJs clickJs
public static ClickHelperAction clickAction
public static ExcelObject excel_setExcelFile(ExcelObject excel) throws Exception
Path - SheetName - Exceptionpublic static List<String> excel_getColumData(ExcelObject excel) throws Exception
colNum - Exceptionpublic static String excel_getCellData(ExcelObject excel) throws Exception
RowNum - ColNum - Exceptionpublic static void excel_setCellData(ExcelObject excel) throws Exception
excel - - required: excel.row, excel.column, excel.value, excel.fileExceptionpublic static void excel_setCellData(List<ExcelObject> excelObjects) throws Exception
excelObjects - - contains data infoExceptionpublic static void setLegacyDriver(org.openqa.selenium.WebDriver driver)
public static void setLegacyDriver(org.openqa.selenium.WebDriver driver,
boolean isPropertyDisabled,
int timeoutSec,
int implicitSec)
protected static EnhancedWebElement findElements(org.openqa.selenium.WebElement parent, org.openqa.selenium.WebElement child)
element - parent - protected static EnhancedWebElement findElements(org.openqa.selenium.WebElement element)
element - protected static EnhancedWebElement findElements(org.openqa.selenium.WebElement parent, int parentIndex, org.openqa.selenium.WebElement child)
element - parent - public static void clickAndExpect(org.openqa.selenium.WebElement target,
org.openqa.selenium.WebElement expected)
target - expected - public static void clickAndExpect(org.openqa.selenium.WebElement target,
String text,
org.openqa.selenium.WebElement expected)
target - text - expected - public void clickAndExpectContainsByText(org.openqa.selenium.WebElement target,
String text,
org.openqa.selenium.WebElement expected)
target - text - expected - public static void clickAndExpect(org.openqa.selenium.WebElement target,
org.openqa.selenium.WebElement expected,
boolean isMobileRefresh)
target - expected - public static void clickAndExpect(org.openqa.selenium.WebElement target,
int index,
org.openqa.selenium.WebElement expected1,
org.openqa.selenium.WebElement expected2)
target - index - expected1 - expected2 - public static void clickAndExpect(org.openqa.selenium.WebElement target,
int index,
org.openqa.selenium.WebElement expected)
target - index - expected - public static void clickAndExpect(org.openqa.selenium.WebElement target,
org.openqa.selenium.WebElement expected,
org.openqa.selenium.WebElement spinner)
target - expected - spinner - public static void clickAndNotExpect(org.openqa.selenium.WebElement target,
org.openqa.selenium.WebElement expected)
target - expected - public static void clickAndWait(org.openqa.selenium.WebElement target,
double timeInSeconds)
target - expected - public static void clickAndWait(org.openqa.selenium.WebElement target,
int index,
double timeInSeconds)
target - expected - public static void clickAndNotExpect(org.openqa.selenium.WebElement target,
int index,
org.openqa.selenium.WebElement expected)
public static void clickElementLocationBy(org.openqa.selenium.WebElement target,
int x,
int y)
by - by elementx - x offset coordinatey - y offset coordinatepublic static void clickPointsAndExpect(int x,
int y,
org.openqa.selenium.WebElement expected)
x - y - expected - public static void doubleClick(org.openqa.selenium.WebElement target,
int index)
target - index - public static void rightClick(org.openqa.selenium.WebElement target,
int index)
target - index - public static void clickElementContinsByText(org.openqa.selenium.WebElement target,
String text)
by - text - public static void clickAndHold(org.openqa.selenium.WebElement target,
double seconds)
target - seconds - public static void clickAndHold(org.openqa.selenium.WebElement target,
int index,
double seconds)
target - index - seconds - public static void dragAndDrop(org.openqa.selenium.WebElement src,
org.openqa.selenium.WebElement target)
src - target - public void dragAndDrop(org.openqa.selenium.WebElement srcParent,
int srcParentIndex,
org.openqa.selenium.WebElement srcChild,
int scrChildIndex,
org.openqa.selenium.WebElement targetParent,
int targeParenttIndex,
org.openqa.selenium.WebElement targetChild,
int targetChildIndex)
src - target - public static void dragAndDrop(org.openqa.selenium.WebElement src,
int xOffset,
int yOffset)
src - target - public static void verifyElementIsDisplayed(org.openqa.selenium.WebElement target)
by - public static boolean isDisplayed(org.openqa.selenium.WebElement target)
element - public static boolean isPresent(org.openqa.selenium.WebElement target)
element - public static boolean isElementContainingText(org.openqa.selenium.WebElement target,
String text)
element - text - public static void verifyElementContainingText(org.openqa.selenium.WebElement target,
String text)
element - text - public void verifyToolTip(org.openqa.selenium.WebElement tooltip,
int index,
String text)
tooltip - index - text - public static void verifyElementIsNotDisplayed(org.openqa.selenium.WebElement target)
by - public static void verifyElementText(org.openqa.selenium.WebElement target,
String value)
by - value - public static void verifyElementCount(org.openqa.selenium.WebElement target,
int value,
int... correction)
by - value - public static void verifyAnyTextContaining(org.openqa.selenium.WebElement target,
String... values)
target - values - public static void verifyAnyText(org.openqa.selenium.WebElement target,
String... values)
target - values - public static void setField(String value, org.openqa.selenium.WebElement field, int index)
value - field - index - public static void setField(org.openqa.selenium.WebElement field,
CharSequence... value)
field - value - public static void setFieldByAction(org.openqa.selenium.WebElement field,
int index,
CharSequence... value)
public static void setFieldByAction(org.openqa.selenium.WebElement field,
CharSequence... value)
public static void setFieldByJs(org.openqa.selenium.WebElement field,
int index,
CharSequence... value)
public static void setFieldByJs(org.openqa.selenium.WebElement field,
CharSequence... value)
public static void clearAndSetField(org.openqa.selenium.WebElement field,
CharSequence... value)
field - value - public static void clearAndSetField(org.openqa.selenium.WebElement field,
int index,
CharSequence... value)
field - index - value - public static void setChildField(org.openqa.selenium.WebElement parent,
int parentIndex,
org.openqa.selenium.WebElement child,
int childIndex,
CharSequence... value)
parent - parentIndex - child - childIndex - value - public static void setFieldAndEnter(org.openqa.selenium.WebElement field,
CharSequence... value)
field - value - public static void setKey(org.openqa.selenium.Keys key,
org.openqa.selenium.WebElement field)
key - field - public static void formSubmit(org.openqa.selenium.WebElement button,
org.openqa.selenium.WebElement expected)
button - expected - public static void formSubmit(org.openqa.selenium.WebElement button,
org.openqa.selenium.WebElement expected,
org.openqa.selenium.WebElement spinner)
button - expected - spinner - public static void selectDropDownWithDoubleClick(String option, org.openqa.selenium.WebElement field, org.openqa.selenium.WebElement listValue)
option - field - list - public static void selectDropDownWithDoubleClick(String option, org.openqa.selenium.WebElement field, int index, org.openqa.selenium.WebElement listValue)
option - field - list - public static void selectDropDown(org.openqa.selenium.WebElement field,
org.openqa.selenium.WebElement list,
String... options)
option - : list option we want to selectfield - : the drop down fieldlist - : the list items in the drop down list@Deprecated public static void selectDropDown(String option, org.openqa.selenium.WebElement field, org.openqa.selenium.WebElement listValue)
option - : list option we want to selectfield - : the drop down fieldlist - : the list items in the drop down listpublic static void selectDropDown(String option, org.openqa.selenium.WebElement field, String field_Identifier, org.openqa.selenium.WebElement listValue)
option - field - field_Identifier - list - public static void selectDropDown(int index,
org.openqa.selenium.WebElement field,
org.openqa.selenium.WebElement listValue)
index - field - list - public static void selectDropDown(org.openqa.selenium.WebElement field,
org.openqa.selenium.WebElement item)
index - field - list - public static void selectDropDown(String option, org.openqa.selenium.WebElement field, org.openqa.selenium.WebElement listValue, int listIndex)
option - field - list - listIndex - public static void selectDropDown(String option, org.openqa.selenium.WebElement field, int index, org.openqa.selenium.WebElement list, int listIndex)
option - field - index - list - listIndex - public static void selectDropDown(String option, org.openqa.selenium.WebElement field, int index, org.openqa.selenium.WebElement listValue)
option - field - index - list - public static void selectCheckBox(org.openqa.selenium.WebElement button,
boolean isSelect)
button - isSelect - public static void selectRadioButton(String option, org.openqa.selenium.WebElement buttons)
option - buttons - public static void selectRadioButton(org.openqa.selenium.WebElement button)
button - public static void selectMultipleCheckboxOptions(List<String> selections, org.openqa.selenium.WebElement checkboxes)
selections - checkboxes - public static void uploadFile(String location, org.openqa.selenium.WebElement imageButton)
location - imageButton - public static void uploadImages(List<String> locations, org.openqa.selenium.WebElement imageButton, org.openqa.selenium.WebElement images)
location - imageButton - images - : uploaded imagepublic static void uploadImage(String location, org.openqa.selenium.WebElement imageButton, org.openqa.selenium.WebElement images)
location - imageButton - images - : uploaded imagepublic static String getTextValue(org.openqa.selenium.WebElement target)
element - public static String getTextValue(org.openqa.selenium.WebElement target, int index)
element - public boolean isElementEditable(org.openqa.selenium.WebElement target)
element - index - public boolean isElementEditable(org.openqa.selenium.WebElement target,
int index)
element - index - public static void selectElementInList(org.openqa.selenium.WebElement listValue,
int index)
list - index - public static void searchAndWaitForResults(String searchQuery, org.openqa.selenium.WebElement target, org.openqa.selenium.WebElement spinner)
searchQuery - byTarget - spinner - public static void selectListItemEqualsByName(org.openqa.selenium.WebElement listValue,
String option)
list - option - public static void selectListItemEqualsByName(org.openqa.selenium.WebElement listValue,
String option,
org.openqa.selenium.WebElement target)
list - option - target - public static void selectListItemContainsByName(org.openqa.selenium.WebElement listValue,
String option,
org.openqa.selenium.WebElement target)
list - option - target - public static int getElementIndexInList(org.openqa.selenium.WebElement srcList,
org.openqa.selenium.WebElement target)
list - target - public List<String> getRowValuesFromList(org.openqa.selenium.WebElement srclist, int index, org.openqa.selenium.WebElement rows)
list - index - rows - public HashMap<String,List<String>> getTableMap(org.openqa.selenium.WebElement columns, org.openqa.selenium.WebElement dataRows, org.openqa.selenium.WebElement dataCells)
columns - dataRows - public HashMap<String,List<String>> getTableMap(org.openqa.selenium.WebElement columns, org.openqa.selenium.WebElement dataRows, org.openqa.selenium.WebElement dataCells, int maxRows)
columns - dataRows - dataCells - maxRows - public HashMap<String,List<String>> getTableMap(org.openqa.selenium.WebElement columns, int columnInitialIndex, org.openqa.selenium.WebElement dataRows, int rowInitialIndex, org.openqa.selenium.WebElement dataCells, int maxRows)
columns - columnInitialIndex - dataRows - rowInitialIndex - dataCells - maxRows - public static void selectElementContainedInList(org.openqa.selenium.WebElement listValue,
String option,
org.openqa.selenium.WebElement target,
int targetIndex)
list - option - target - public static void selectElementContainedInList(org.openqa.selenium.WebElement listValue,
String option,
org.openqa.selenium.WebElement target)
list - option - target - public static void selectListItemContainsByName(org.openqa.selenium.WebElement listValue,
String option)
list - option - public static void selectListItemByIndex(org.openqa.selenium.WebElement listValue,
int index)
list - option - public static int getListCount(org.openqa.selenium.WebElement listValue)
list - public static int getElementIndexEqualsByText(org.openqa.selenium.WebElement listValue,
String option)
list - option - public static int getElementIndexContainByText(org.openqa.selenium.WebElement listValue,
String option)
list - option - public static int getStringIndexContainByText(List<String> stringList, String option)
stringList - normalizedoption - normalizedpublic static void verifyContainsIsInList(org.openqa.selenium.WebElement listValue,
String option)
list - option - public static void verifyIsInList(org.openqa.selenium.WebElement listValue,
String option)
list - option - public static void verifyIsInList(org.openqa.selenium.WebElement listValue,
String indicator,
String option)
list - indicator - option - public static boolean isContainedInList(org.openqa.selenium.WebElement listValue,
String option)
list - option - public static boolean isExactMatchInList(org.openqa.selenium.WebElement listValue,
String option)
list - option - public static List<String> getListValues(org.openqa.selenium.WebElement listValue)
list - public static List<String> getTextList(org.openqa.selenium.WebElement listValue)
list - public void mobile_swipeRight(org.openqa.selenium.WebElement element,
int index,
double durationInSeconds)
public void mobile_swipeLeft(org.openqa.selenium.WebElement element,
int index,
double durationInSeconds)
public void mobile_swipeUp(org.openqa.selenium.WebElement element,
int index,
double durationInSeconds)
public void mobile_swipeDown(org.openqa.selenium.WebElement element,
int index,
double durationInSeconds)
public static void mobile_longPress(org.openqa.selenium.WebElement target,
long miliSeconds)
target - index - miliSeconds - expected - public static void mobile_longPressAndExpect(org.openqa.selenium.WebElement target,
long miliSeconds,
org.openqa.selenium.WebElement expected)
target - miliSeconds - expected - public static void mobile_zoomOut(org.openqa.selenium.WebElement indicator)
zoomLevel - indicator - public static void mobile_zoomIn(org.openqa.selenium.WebElement indicator)
zoomLevel - indicator - public static void mobile_scrollToElement(org.openqa.selenium.WebElement target)
target - public static void switchIframe(org.openqa.selenium.WebElement frame)
frame - public static Boolean isVisibleInViewport(org.openqa.selenium.WebElement element, int index)
by - public static void scrollToWebElement(org.openqa.selenium.WebElement element)
element - public static void scrollToWebElement(org.openqa.selenium.WebElement element,
int index)
element - index - public static Boolean isVisibleInViewport(org.openqa.selenium.WebElement element)
by - public static String getAttribute(org.openqa.selenium.WebElement byValue, String attribute)
byValue - index - attribute - public static boolean isElementContainingClass(org.openqa.selenium.WebElement element,
String classValue)
by - classValue - public static boolean isAttributeContaining(org.openqa.selenium.WebElement element,
String attribute,
String value)
by - classValue - public static String getAttribute(org.openqa.selenium.WebElement element, int index, String attribute)
byValue - index - attribute - public static void setAttribute(org.openqa.selenium.WebElement element,
String attribute,
String value)
by - attribute - value - public static void setAttribute(org.openqa.selenium.WebElement element,
int index,
String attribute,
String value)
by - index - attribute - value - public static org.openqa.selenium.Dimension getElementSize(org.openqa.selenium.WebElement element)
by - public static org.openqa.selenium.Point getElementPosition(org.openqa.selenium.WebElement element)
by - public static org.openqa.selenium.Point getElementPosition(org.openqa.selenium.WebElement element,
int index)
by - index - public static int[] findElementCoordinates(org.openqa.selenium.WebElement target)
target - public static int[] findMiddleOfElement(org.openqa.selenium.WebElement target)
target - public static void waitForElementToLoad(org.openqa.selenium.WebElement target)
target - public static boolean waitForElementToLoad(org.openqa.selenium.WebElement target,
int time)
target - time - public static boolean waitForFirstElementToLoad(org.openqa.selenium.WebElement element1,
org.openqa.selenium.WebElement element2,
org.openqa.selenium.WebElement element3)
element1 - element2 - time - public static boolean waitForFirstElementToLoad(org.openqa.selenium.WebElement element1,
org.openqa.selenium.WebElement element2,
org.openqa.selenium.WebElement element3,
int time)
element1 - element2 - time - public static boolean waitForFirstElementToLoad(org.openqa.selenium.WebElement element1,
org.openqa.selenium.WebElement element2,
int time)
element1 - element2 - time - public static boolean waitForFirstElementToLoad(org.openqa.selenium.WebElement element1,
org.openqa.selenium.WebElement element2)
element1 - element2 - time - public static void mobile_waitAndRefreshForElementToLoad(org.openqa.selenium.WebElement target,
int time)
target - public static void mobile_waitAndRefreshForElementToLoad(org.openqa.selenium.WebElement target)
target - public static boolean waitForElementToLoad(org.openqa.selenium.WebElement target,
int time,
int count)
target: - element to wait fortime: - max time to waitcount: - minimum count of elements to wait for in listpublic static void waitForAdditionalElementsToLoad(org.openqa.selenium.WebElement target,
int originalCount)
target - originalCount - public static void waitForAdditionalElementsToLoad(org.openqa.selenium.WebElement target,
int originalCount,
int time)
target - originalCount - public static boolean waitForElementToBeRemoved(org.openqa.selenium.WebElement target)
target - public static boolean waitForElementToBeRemoved(org.openqa.selenium.WebElement target,
int time)
target - time - : maximum amount of time in seconds to waitpublic static boolean waitForElementToBeRemoved(org.openqa.selenium.WebElement target,
int time,
int waitForTargetToLoadInSeconds)
target - time - : maximum amount of time in seconds to wait. use AbstractDriver.TIMEOUT_SECONDS for default timeoutwaitForTargetToLoadInSeconds - wait for element to load before waiting for element to be removedpublic static void waitForListItemToLoad_Contains(org.openqa.selenium.WebElement list,
String option)
list - option - time - public static void waitForTextToLoad(org.openqa.selenium.WebElement target,
String text)
target - public static void waitForTextToLoad(org.openqa.selenium.WebElement target,
int time,
String text)
target - time - public static boolean waitForElementToBeClickable(org.openqa.selenium.WebElement selector)
selector - public static boolean waitForElementToBeClickable(org.openqa.selenium.WebElement selector,
int timeInSeconds)
selector - public boolean waitForClassContain(org.openqa.selenium.WebElement target,
int index,
String value)
target - index - value - public boolean waitForClassContain(org.openqa.selenium.WebElement target,
int index,
String value,
int time)
target - index - value - time - public static boolean waitForAnyTextToLoadContaining(org.openqa.selenium.WebElement target,
String... text)
target - time - text - public static boolean waitForAnyTextToLoadContaining(org.openqa.selenium.WebElement target,
int time,
String... text)
target - time - text - public static boolean waitForAnyTextToLoad(org.openqa.selenium.WebElement target,
String... text)
target - time - text - public static boolean waitForAnyTextToLoad(org.openqa.selenium.WebElement target,
int time,
String... text)
target - time - text - public static void highLightWebElement(org.openqa.selenium.WebElement target,
int index)
by - index - public static void hoverBy(org.openqa.selenium.WebElement element)
by - public static void hoverBy(org.openqa.selenium.WebElement element,
int index)
by - public void inputTextByAction(org.openqa.selenium.WebElement element,
String text)
public static void doubleClickBy(org.openqa.selenium.WebElement element)
public static void moveToElement(org.openqa.selenium.WebElement target,
int index)
target - index - public static void moveToElement(org.openqa.selenium.WebElement target,
int index,
int xOffset,
int yOffset)
target - index - public static void assertTrue(String message, boolean value)
message - if failvalue - public static void assertFalse(String message)
public static void assertEquals(String expected, String actual)
expected - actual - public static void assertEquals(boolean expected,
boolean actual)
expected - actual - public static void assertEquals(int expected,
int actual)
expected - actual - public static void assertContains(String expected, String actual)
actual - expected - public static void softAssertTrue(String message, boolean value)
public static void softAssertEqual(int expected,
int actual)
public static org.testng.asserts.SoftAssert softAssert()
public static void softAssertAll()
public static void logStackTrace(AssertionError e)
public static void logStackTrace(Exception e)
public static EnhancedBy byCss(String element, String name)
element - name - public static EnhancedBy byId(String element, String name)
element - name - public static EnhancedBy byXpath(String element, String name)
element - name - public static EnhancedBy byAccessibility(String element, String name)
element - name - public static void clickAndExpect(EnhancedBy target, EnhancedBy expected)
target - expected - public static void clickAndExpect(EnhancedBy target, String text, EnhancedBy expected)
target - text - expected - public void clickAndExpectContainsByText(EnhancedBy target, String text, EnhancedBy expected)
clickAndExpectContainsByText in class Helpertarget - text - expected - public static void clickAndExpect(EnhancedBy target, EnhancedBy expected, boolean isMobileRefresh)
target - expected - public static void clickAndExpect(EnhancedBy target, int index, EnhancedBy expected1, EnhancedBy expected2)
target - index - expected1 - expected2 - public static void clickAndExpect(EnhancedBy target, int index, EnhancedBy expected)
target - index - expected - public static void clickAndExpect(EnhancedBy target, EnhancedBy expected, EnhancedBy spinner)
target - expected - spinner - public static void clickAndNotExpect(EnhancedBy target, EnhancedBy expected)
target - expected - public static void clickAndWait(EnhancedBy target, double timeInSeconds)
target - expected - public static void clickAndWait(EnhancedBy target, int index, double timeInSeconds)
target - expected - public static void clickAndNotExpect(EnhancedBy target, int index, EnhancedBy expected)
public static void clickElementLocationBy(EnhancedBy by, int x, int y)
by - by elementx - x offset coordinatey - y offset coordinatepublic static void clickPoints(int x,
int y)
x - y - public static void clickPointsAndExpect(int x,
int y,
EnhancedBy expected)
x - y - expected - public static void doubleClickPoints(int x,
int y)
x - y - public static void doubleClick(EnhancedBy target, int index)
target - index - public static void rightClick(EnhancedBy target, int index)
target - index - public static void clickElementContinsByText(EnhancedBy by, String text)
by - text - public static void clickAndHold(EnhancedBy target, double seconds)
target - seconds - public static void clickAndHold(EnhancedBy target, int index, double seconds)
target - index - seconds - public static void dragAndDrop(EnhancedBy src, EnhancedBy target)
src - target - public void dragAndDrop(EnhancedBy srcParent, int srcParentIndex, EnhancedBy srcChild, int scrChildIndex, EnhancedBy targetParent, int targeParenttIndex, EnhancedBy targetChild, int targetChildIndex)
dragAndDrop in class Helpersrc - target - public static void dragAndDrop(EnhancedBy src, int xOffset, int yOffset)
src - target - public static void verifyElementIsDisplayed(EnhancedBy by)
by - public static boolean isDisplayed(EnhancedBy element)
element - public static boolean isPresent(EnhancedBy element)
element - public static boolean isElementContainingText(EnhancedBy element, String text)
element - text - public static void verifyElementContainingText(EnhancedBy element, String text)
element - text - public static void verifyTextDisplayed(String text)
text - public static boolean isTextDisplayed(String text)
text - public void verifyToolTip(EnhancedBy tooltip, int index, String text)
verifyToolTip in class Helpertooltip - index - text - public static void verifyElementIsNotDisplayed(EnhancedBy by)
by - public static void verifyElementText(EnhancedBy by, String value)
by - value - public static void verifyElementCount(EnhancedBy by, int value, int... correction)
by - value - public static void verifyAnyTextContaining(EnhancedBy target, String... values)
target - values - public static void verifyAnyText(EnhancedBy target, String... values)
target - values - public static void setField(String value, EnhancedBy field, int index)
value - field - index - public static void setField(EnhancedBy field, CharSequence... value)
field - value - public static void setFieldByAction(EnhancedBy field, int index, CharSequence... value)
public static void setFieldByAction(EnhancedBy field, CharSequence... value)
public static void setFieldByJs(EnhancedBy field, int index, CharSequence... value)
public static void setFieldByJs(EnhancedBy field, CharSequence... value)
public static void clearAndSetField(EnhancedBy field, CharSequence... value)
field - value - public static void clearAndSetField(EnhancedBy field, int index, CharSequence... value)
field - index - value - public static void setChildField(EnhancedBy parent, int parentIndex, EnhancedBy child, int childIndex, CharSequence... value)
parent - parentIndex - child - childIndex - value - public static void setFieldAndEnter(EnhancedBy field, CharSequence... value)
field - value - public static void setKey(org.openqa.selenium.Keys key,
EnhancedBy field)
key - field - public static void formSubmit(EnhancedBy button, EnhancedBy expected)
button - expected - public static void formSubmit(EnhancedBy button, EnhancedBy expected, EnhancedBy spinner)
button - expected - spinner - public static void selectDropDownWithDoubleClick(String option, EnhancedBy field, EnhancedBy listValue)
option - field - list - public static void selectDropDownWithDoubleClick(String option, EnhancedBy field, int index, EnhancedBy listValue)
option - field - list - public static void selectDropDown(EnhancedBy field, EnhancedBy list, String... options)
option - : list option we want to selectfield - : the drop down fieldlist - : the list items in the drop down list@Deprecated public static void selectDropDown(String option, EnhancedBy field, EnhancedBy listValue)
option - : list option we want to selectfield - : the drop down fieldlist - : the list items in the drop down listpublic static void selectDropDown(String option, EnhancedBy field, String field_Identifier, EnhancedBy listValue)
option - field - field_Identifier - list - public static void selectDropDown(int index,
EnhancedBy field,
EnhancedBy listValue)
index - field - list - public static void selectDropDown(EnhancedBy field, EnhancedBy item)
index - field - list - public static void selectDropDown(String option, EnhancedBy field, EnhancedBy listValue, int listIndex)
option - field - list - listIndex - public static void selectDropDown(String option, EnhancedBy field, int index, EnhancedBy list, int listIndex)
option - field - index - list - listIndex - public static void selectDropDown(String option, EnhancedBy field, int index, EnhancedBy listValue)
option - field - index - list - public static void selectCheckBox(EnhancedBy button, boolean isSelect)
button - isSelect - public static void selectRadioButton(String option, EnhancedBy buttons)
option - buttons - public static void selectRadioButton(EnhancedBy button)
button - public static void selectMultipleCheckboxOptions(List<String> selections, EnhancedBy checkboxes)
selections - checkboxes - public static void uploadFile(String location, EnhancedBy imageButton)
location - imageButton - public static void uploadImages(List<String> locations, EnhancedBy imageButton, EnhancedBy images)
location - imageButton - images - : uploaded imagepublic static void uploadImage(String location, EnhancedBy imageButton, EnhancedBy images)
location - imageButton - images - : uploaded imagepublic static String getTextValue(EnhancedBy element)
element - public static String getTextValue(EnhancedBy element, int index)
element - public boolean isElementEditable(EnhancedBy element)
isElementEditable in class Helperelement - index - public boolean isElementEditable(EnhancedBy element, int index)
isElementEditable in class Helperelement - index - public static void selectElementInList(EnhancedBy listValue, int index)
list - index - public static void selectElementInList(EnhancedBy listValue, int index, EnhancedBy expected)
list - index - expected - public static void searchAndWaitForResults(String searchQuery, EnhancedBy byTarget, EnhancedBy spinner)
searchQuery - byTarget - spinner - public static void selectListItemEqualsByName(EnhancedBy listValue, String option)
list - option - public static void selectListItemEqualsByName(EnhancedBy listValue, String option, EnhancedBy target)
list - option - target - public static void selectListItemContainsByName(EnhancedBy listValue, String option, EnhancedBy target)
list - option - target - public static int getElementIndexInList(EnhancedBy srcList, EnhancedBy target)
list - target - public List<String> getRowValuesFromList(EnhancedBy srclist, int index, EnhancedBy rows)
getRowValuesFromList in class Helperlist - index - rows - public HashMap<String,List<String>> getTableMap(EnhancedBy columns, EnhancedBy dataRows, EnhancedBy dataCells)
getTableMap in class Helpercolumns - dataRows - public HashMap<String,List<String>> getTableMap(EnhancedBy columns, EnhancedBy dataRows, EnhancedBy dataCells, int maxRows)
getTableMap in class Helpercolumns - dataRows - dataCells - maxRows - public HashMap<String,List<String>> getTableMap(EnhancedBy columns, int columnInitialIndex, EnhancedBy dataRows, int rowInitialIndex, EnhancedBy dataCells, int maxRows)
getTableMap in class Helpercolumns - columnInitialIndex - dataRows - rowInitialIndex - dataCells - maxRows - public static void selectElementContainedInList(EnhancedBy listValue, String option, EnhancedBy target, int targetIndex)
list - option - target - public static void selectElementContainedInList(EnhancedBy listValue, String option, EnhancedBy target)
list - option - target - public static void selectListItemContainsByName(EnhancedBy listValue, String option)
list - option - public static void selectListItemByIndex(EnhancedBy listValue, int index)
list - option - public static int getListCount(EnhancedBy listValue)
list - public static int getElementIndexEqualsByText(EnhancedBy listValue, String option)
list - option - public static int getElementIndexContainByText(EnhancedBy listValue, String option)
list - option - public static int getStringIndexEqualsByText(List<String> stringList, String option)
stringList - normalizedoption - normalizedpublic static void verifyContainsIsInList(EnhancedBy listValue, String option)
list - option - public static void verifyIsInList(EnhancedBy listValue, String option)
list - option - public static void verifyIsInList(EnhancedBy listValue, String indicator, String option)
list - indicator - option - public static boolean isContainedInList(EnhancedBy listValue, String option)
list - option - public static boolean isExactMatchInList(EnhancedBy listValue, String option)
list - option - public static List<String> getListValues(EnhancedBy listValue)
list - public static List<String> getTextList(EnhancedBy listValue)
list - public static io.appium.java_client.android.AndroidDriver getAndroidDriver()
public static io.appium.java_client.ios.IOSDriver getiOSDriver()
public static void mobile_hideKeyboard()
public static void pressEnterOnAndroid()
public static void mobile_resetApp()
public static void refreshMobileApp()
public static boolean mobile_isMobile()
public static boolean isInternetExplorer()
public static boolean isIOS()
public static boolean isAndroid()
public static boolean isWebDriver()
public static void mobile_setLocation(org.openqa.selenium.html5.Location location)
location - public void mobile_swipeRight(double durationInSeconds)
mobile_swipeRight in class Helperpublic void mobile_swipeRight(EnhancedBy element, int index, double durationInSeconds)
mobile_swipeRight in class Helperpublic void mobile_swipeLeft(double durationInSeconds)
mobile_swipeLeft in class Helperpublic void mobile_swipeLeft(EnhancedBy element, int index, double durationInSeconds)
mobile_swipeLeft in class Helperpublic void mobile_swipeUp(EnhancedBy element, int index, double durationInSeconds)
mobile_swipeUp in class Helperpublic void mobile_swipeUp(double durationInSeconds)
mobile_swipeUp in class Helperpublic void mobile_swipeDown(double durationInSeconds)
mobile_swipeDown in class Helperpublic void mobile_swipeDown(EnhancedBy element, int index, double durationInSeconds)
mobile_swipeDown in class Helperpublic static void mobile_switchToNativeView()
context - public static void mobile_switchToWebView()
context - public void mobile_switchToView(String view)
mobile_switchToView in class Helperview - public Set<String> mobile_getContextList()
mobile_getContextList in class Helperpublic static void mobile_longPress(EnhancedBy target, long miliSeconds)
target - index - miliSeconds - expected - public static void mobile_longPressAndExpect(EnhancedBy target, long miliSeconds, EnhancedBy expected)
target - miliSeconds - expected - public static void mobile_zoomOut(int zoomLevel)
zoomLevel - public static void mobile_zoomOut(EnhancedBy indicator)
zoomLevel - indicator - public static void mobile_zoomIn(EnhancedBy indicator)
zoomLevel - indicator - public static void mobile_zoomIn(int zoomLevel)
zoomLevel - public static void scrollDown()
public static void mobile_scrollToElement(EnhancedBy target)
target - public static void maximizePage()
public static void setPageSize(int x,
int y)
x - y - public static void refreshPage()
public static void switchIframe(EnhancedBy frame)
frame - public static void switchToDefaultFrame()
public static String dimissAlert()
alert - public static String acceptAlert()
alert - public static String getAlertValue()
public static String currentWindow()
public static void switchToNewWindow(String defaultWindow)
defaultWindow - public static void CloseAndReturn(String defaultWindow)
defaultWindow - public static void refreshPageSource()
public static void verifyTitle(String appTitle)
appTitle - public static void switchDriver(org.openqa.selenium.WebDriver driver)
driver - public static void setDriver(org.openqa.selenium.WebDriver driver)
public static void switchToNextTab()
public static void switchToPreviousTab()
public static void switchToTab(int index)
public static void verifyNumberOfTabs(int tabs)
public static String getPageTitle()
public static String getCurrentUrl()
public static String getPageSource()
public static void navigateBack()
public static void navigateForward()
public static void deleteAllCookies()
public static void deleteCookieNamed(String name)
name - public static void bringPageToFront()
public static void swtichUrl(String url)
url - public static void getUrl(String url)
url - public static void navigateToUrl(String url)
url - public static String getClipboardData()
public static void quitCurrentDriver()
public static void quitDriver(org.openqa.selenium.WebDriver driver)
driver - public static void quitAllCurrentTestDrivers()
public static Boolean isVisibleInViewport(EnhancedBy by, int index)
by - public static org.openqa.selenium.WebDriver getWebdriver()
public static void scrollBottomPageBrowser()
public static void scrollUpBrowser(int count)
public static void scrollUpBrowser()
public static void scrollDownBrowser(int count)
public static void scrollDownBrowser()
public static void scrollToWebElement(EnhancedBy element)
element - public boolean isMicrosoftEdge()
isMicrosoftEdge in class Helperpublic static void scrollToWebElement(EnhancedBy element, int index)
element - index - public static Boolean isVisibleInViewport(EnhancedBy by)
by - public static String getAttribute(EnhancedBy byValue, String attribute)
byValue - index - attribute - public static boolean isElementContainingClass(EnhancedBy by, String classValue)
by - classValue - public static boolean isAttributeContaining(EnhancedBy by, String attribute, String value)
by - classValue - public static String getAttribute(EnhancedBy byValue, int index, String attribute)
byValue - index - attribute - public static void setAttribute(EnhancedBy by, String attribute, String value)
by - attribute - value - public static void setAttribute(EnhancedBy by, int index, String attribute, String value)
by - index - attribute - value - public static org.openqa.selenium.Dimension getElementSize(EnhancedBy by)
by - public static org.openqa.selenium.Point getElementPosition(EnhancedBy by)
by - public static org.openqa.selenium.Point getElementPosition(EnhancedBy by, int index)
by - index - public static int[] findElementCoordinates(EnhancedBy target)
target - public static int[] findMiddleOfElement(EnhancedBy target)
target - public static void waitForElementToLoad(EnhancedBy target)
target - public static boolean waitForElementToLoad(EnhancedBy target, int time)
target - time - public static boolean waitForFirstElementToLoad(EnhancedBy element1, EnhancedBy element2, EnhancedBy element3)
element1 - element2 - time - public static boolean waitForFirstElementToLoad(EnhancedBy element1, EnhancedBy element2, EnhancedBy element3, int time)
element1 - element2 - time - public static boolean waitForFirstElementToLoad(EnhancedBy element1, EnhancedBy element2, int time)
element1 - element2 - time - public static boolean waitForFirstElementToLoad(EnhancedBy element1, EnhancedBy element2)
element1 - element2 - time - public static void mobile_waitAndRefreshForElementToLoad(EnhancedBy target, int time)
target - public static void mobile_waitAndRefreshForElementToLoad(EnhancedBy target)
target - public static boolean waitForElementToLoad(EnhancedBy target, int time, int count)
target: - element to wait fortime: - max time to waitcount: - minimum count of elements to wait for in listpublic static void waitForAdditionalElementsToLoad(EnhancedBy target, int originalCount)
target - originalCount - public static void waitForAdditionalElementsToLoad(EnhancedBy target, int originalCount, int time)
target - originalCount - public static boolean waitForElementToBeRemoved(EnhancedBy target)
target - public static boolean waitForElementToBeRemoved(EnhancedBy target, int time)
target - time - : maximum amount of time in seconds to waitpublic static boolean waitForElementToBeRemoved(EnhancedBy target, int time, int waitForTargetToLoadInSeconds)
target - time - : maximum amount of time in seconds to wait. use AbstractDriver.TIMEOUT_SECONDS for default timeoutwaitForTargetToLoadInSeconds - wait for element to load before waiting for element to be removedpublic static void waitForSeconds(double seconds)
seconds - public static void waitForPageToLoad()
public static void waitForListItemToLoad_Contains(EnhancedBy list, String option)
list - option - time - public static void waitForTextToLoad(EnhancedBy target, String text)
target - public static void waitForTextToLoad(EnhancedBy target, int time, String text)
target - time - public static boolean waitForElementToBeClickable(EnhancedBy selector)
selector - public static boolean waitForElementToBeClickable(EnhancedBy selector, int timeInSeconds)
selector - public boolean waitForClassContain(EnhancedBy target, int index, String value)
waitForClassContain in class Helpertarget - index - value - public boolean waitForClassContain(EnhancedBy target, int index, String value, int time)
waitForClassContain in class Helpertarget - index - value - time - public static boolean waitForAnyTextToLoadContaining(EnhancedBy target, String... text)
target - time - text - public static boolean waitForAnyTextToLoadContaining(EnhancedBy target, int time, String... text)
target - time - text - public static boolean waitForAnyTextToLoad(EnhancedBy target, String... text)
target - time - text - public static boolean waitForAnyTextToLoad(EnhancedBy target, int time, String... text)
target - time - text - public static StopWatchHelper start()
public static String generateRandomString(int len)
len - public static String generateRandomInteger(int len)
len - public static int generateRandomNumber(int min,
int max)
min - max - public static String generateUUID()
public static String generateUUID(boolean includeDash)
includeDash - public static String generateUUID(int length)
length - public static String generateUUID(int length, boolean includeDash)
length - public static void highLightWebElement(EnhancedBy by, int index)
by - index - public static boolean isMac()
public static boolean isWindows()
public static boolean isUnix()
public static boolean isUUID(String value)
value - public static boolean isBoolean(String value)
value - public static boolean isNumeric(String value)
str - public static Object executeJs(String script, Object... args)
script - public static List<String> executeJsWithListReturn(String script, Object... args)
script - public static String executeJsWithStringReturn(String script, Object... args)
script - public static int getIntFromString(String value)
value - isFailOnNoInt - public static int getNumber(String value)
value - isFailOnNoInt - public static int getFirstNumber(String value)
public static int getIntFromString(String value, boolean isFailOnNoInt)
value - isFailOnNoInt - public static double getDoubleFromString(String value)
value - isFailOnNoInt - public static boolean isStringContainOnlyNumber(String value)
value - public static boolean isStringContainNumber(String value)
value - public static String removeSurroundingQuotes(String value)
value - public static URL convertToUrl(String url)
url - public static boolean isUrlAbleToConnect(URL source, Proxy proxy)
source - proxy - set to null if no proxypublic static boolean isProxyRequired(URL url)
url - public static double getDoubleFromString(String value, boolean isFailOnNoInt)
value - isFailOnNoInt - public static boolean isFileContainString(String value, File file)
value - file - public static boolean isFileContainsString(String value, File file)
value - file - public static List<String> getLinesInFileStartingWith(String value, File file)
value - file - public static List<String> getLinesInFileContainingWith(String value, File file)
value - file - public static void printPageSource()
public static String convertListToString(ArrayList<String> list, String separator)
list - public static String convertListToString(ArrayList<String> list)
list - public static String stringNormalize(String value)
value - public static String stringRemoveLines(String value)
value - public static void killWindowsProcess(String serviceName)
serviceName - Exceptionpublic static void killMacProcess(String serviceName)
serviceName - Exceptionpublic static File createFileFromPath(String absolutePath)
path - public static void writeFile(String value, String path, String filename, String type)
value - value in filepath - path from rootfilename - name of the filetype - type of filepublic static void writeFile(String value, String absolutePath)
value - absolutePath - public static void deleteFile(String absolutePath)
absolutePath - public static void appendToFile(String value, String absolutePath)
value - absolutePath - public static void appendToFile(String value, String directory, String filename, String type)
value - directory - filename - type - public static ArrayList<String> executeCommand(String command)
command - IOExceptionpublic static ArrayList<String> executeCommandFromFile(String filePath)
filePath - path from the root directory ( where pom.xml is )public static void copyDirectory(String dirFrom, String dirTo)
dirFrom - dirTo - public static ZipOutputStream zipFolder(String srcFolder, String destZipFile)
srcFolder - destZipFile - Exceptionpublic static ZipOutputStream createZip(String destZipFile)
public static void addFileToZip(String path, String srcFile, ZipOutputStream zip)
public static List<String> getAllValuesStartringWith(String source, String value)
source - value - public static String getValueFromPattern(String str, String pattern)
str - pattern - regular expression patternpublic static List<String> getValuesFromPattern(String str, String pattern)
str - pattern - regular expression patternpublic static String getRootDir()
public static File getFile(String directoryPath)
directoryPath - public static File getFileByName(String path, String filename)
path - filename - public static File getFileByName(String path, String filename, boolean includeSubDir)
path - filename - public static ArrayList<File> getFileListByType(String directoryPath, String type, boolean includeSubtype)
public static ArrayList<File> getFileListByType(String directoryPath, String type)
public static ArrayList<File> getFileList(String directoryPath)
directoryPath - public static String getFullPath(String path)
path - public static ArrayList<File> getFileList(String directoryPath, boolean includeSubDir)
directoryPath - public static List<File> getFileListWithSubfolders(String directoryName, List<File> files)
public static List<File> getFileListWithSubfolders(String directoryName, String type, List<File> files)
public static String readFileContent(String absolutePath)
absolutePath - public static String getFileContent(String absolutePath)
absolutePath - public static String getFileContent(String absolutePath, boolean verifyFileExists)
absolutePath - public static void captureExtentReportScreenshot()
description - public static void screenshotCapture()
public static void hoverBy(EnhancedBy by)
by - public static void hoverBy(EnhancedBy by, int index)
by - public void inputTextByAction(EnhancedBy by, String text)
inputTextByAction in class Helperpublic static void doubleClickBy(EnhancedBy by)
public static void hoverPoints(int x,
int y)
x - y - public static void moveToElement(EnhancedBy target, int index)
target - index - public static void moveToElement(EnhancedBy target, int index, int xOffset, int yOffset)
target - index - public static void sendMail(EmailObject email)
Exceptionpublic static void handleDifferentUser()
newUserName - Exceptionpublic static String localize(String key)
key - public static void localizationLoadJson(String fileName)
fileName - public static void localizationSetupCsv(String language)
language - public static void runApiContaining(String identifier, String prefix, String getApi, String targetApiId, String variable, String targerApi) throws org.json.JSONException
getApi: - api to search for identifier. eg. name containing "zzz"prefix: - value containing in getApi. eg. name containing "zzz"identifier: - api to call to get all values. eg. getCompaniestargetApiId: - id used to call target api.eg. id for deleteCompany apivariable: - variable the id is stored in csv keyword file. eg
companyIdtargerApi: - api to call. eg. deleteCompanyorg.json.JSONExceptionpublic static void runApiEquals(String identifier, String value, String getApi, String targetApiId, String variable, String targerApi) throws org.json.JSONException
getApi: - api to search for identifier. eg. name equals "test123"value: - value containing in getApi. eg. name equals "test123"identifier: - api to call to get all values. eg. getCompaniestargetApiId: - id used to call target api.eg. id for deleteCompany apivariable: - variable the id is stored in csv keyword file. eg
companyIdtargerApi: - api to call. eg. deleteCompanyorg.json.JSONExceptionCopyright © 2022. All rights reserved.