Functions available in a testTemplate for your tests
clearCookies()
createListFromColumn($columnIndex,$excelData,$startRowIndex)
createListFromRow($rowIndex,$excelData,$startColIndex)
removeTrailingEmptyValues($array)
removeAllEmptyValues($array)
getUrl() //get the browser's url in the address bar
getDomain()
waitAfterNavigate($milliseconds) //if there is another http request after the page is done loading, this will cause Sahi to start to wait again. Use sparingly. It is better just to use _wait, as it uses an if(_condition), which could cause a 150-second crash.
roundDecimal($value, $decimalPlace)
extractPricesAsStrings($element) //get an array of prices from an element like a div
getPriceStr($element) //get a price from a text element (with its comma)
extractPricesAsNumbers($element)
getPrice($element) //as a number
convertPriceToNumber($priceStr)
getTimeStamp()
detectBrowser()
concatenateUrlParameters($paramList1, $paramList2)//automatically adds the ? and & symbols
getComputedStyle($element)
copyObj($origObj)//returns a copy of an array or object
getText($element)//returns null, not an error, when the element is absent, for better error handling
dayOfYear() - returns the day of year as a number, like 171
convertIndexedObjToArray($object) //this can be used not only for the "arguments" object, but also for a "getElementsByTagName"-like object.
getTextFromClassName($className,$index)
new navigateTable($urlTable,$initialRowIndex,$initialColumnIndex) --if you have a table of urls with a corresponding spreadsheet of expected values per url
screenshot() //adds a screenshot to your online drive folder
logToSpreadsheet($arrayOrStrings) //write to your report history spreadsheet
isReallyNaN($a)
getDailyNumberRotation($maxNumber,$returnArrayOn) //this will provide a number from 1 to the maxNumber on a daily basis, rotating
getCellValue($sheet,$rowIndex,$colIndex){//better than the native Sahi .get() to handle the error caused by empty cells
getHref($link)
logAllProperties($obj)
divOrSpan($identifier)
validateLastDownloadedFileName()
addHeaderIntoURLHistory("text")
readCookie($cookieName){//sometimes the _cookie function in Sahi fails
writeCellNextValue($valuesArray, $currentValue, $sheet, $rowIndex, $colIndex)
matchesAnyPatternInList($arrayOfStringsToConvertToRegexPatterns, $stringToMatch)
is2dArray($array)
indexOfRegexMatch($stringOrRegexPattern, $arrayWithStrings)
isNumeric(num)
waitExists($locator)
copyArrayRemoveItems($array,$itemsToBeRemoved)
exists($element)//for older versions of Sahi to prevent an error when using _near and _in
for use in a _set() function:
get_elements_by_tag_name($tag);