Standard Actions Methods
Qatts provides few handful action methods that help in interacting with the Product to perform automation. The method syntax follows normal Java standards.

Variables

setRunValue

Using setRunValue() method, you can temporarily store a value and utilize it anywhere in the execution at a later point. Note that the value stored can be used only within that execution. setRunValue method is a named-value map, i.e. it holds a value against a key, which can be utilized later by calling getRunValue() method.
setRunValue() in previous releases of QATTS is called as setCache(). However this method is deprecated in the current release.
Syntax:
void setRunValue(String propName, Object cacheValue)
Param Name
Type
Condition
Description
propName
String
Mandatory
The name of the run variable
cacheValue
Object
Mandatory
The value of the run variable. It can be either a static string or can be derived from the test data

getRunValue and getRunValueStr

getRunValue() and getRunValueStr methods are used to retrieve a value set to a variable by setRunValue/setCache methods.
The main difference between getRunValue and getRunValueStr methods lies in their return types. getRunValue returns an Object type and getRunValueStr returns a String type.
syntax:
Object getRunValue(String propName)
String getRunValueStr(String propName)
Param Name
Type
Condition
Description
propName
String
Mandatory
Name of the run variable

Execute Methods

Execute methods normalize a script in an action class and then reuse it in one or more action classes.
QATTS has three types of execute methods
  1. 1.
    executeFunction()
  2. 2.
    executeWorkflow()
  3. 3.
    executeTestCase()

executeFunction

Functions gives much readability, maintainability and re-usability.
Functions make your code much easier to maintain and scale because it is much easier to understand what the code does.
In QATTS, functions are given a name and can be used anywhere in any workflow.
executeFunction() invokes a defined function from a workflow.
Syntax:
void executeFunction(String workFlowName)
Param Name
Type
Condition
Description
workflowName
String
Mandatory
Function or workflow name
void executeWorkflow(String workFlowName)
void executeWorkflow(String workFlowName, String dataName)
void executeWorkflow(String workFlowName, Object testInputObj)
void executeTestCase(String workFlowName, String dataNameRef)
void executeTestCase(TFWorkflow tfWorkflow, String testCaseRef)
void performAPIFieldLevelAction(String apiName, String sectionName)
QData sendRequest(String apiName)
QData sendRequest(String apiName, Map additionalData)
boolean assertData(String groupName,Map baseData,Map targetData)
boolean assertData(String groupName,Map baseData,Map targetData,boolean recursive)
boolean assertData(Object baseData,Object targetData)
Object getContextValue(String keyName)
String getContextValueStr(String keyName)
void setContextValue(String keyName, Object cacheValue)
void createCounter(String counterName,Integer startIndex,String scope)
Integer incrementCounter(String counterName)
boolean checkValue(String elementName,Object targetObj)
boolean hasTestData(String elementName)
String getTestDataStr(String elementName)
String getDataStr(String elementName)
Object getTestData(String elementName)
boolean hasData(String elementName)
Object getData(String elementName)
QData getTestDataByGroup(String groupName,String type,boolean recursive)
QArray getQueryResults(String queryName)
QData getQueryData(String queryName)
void logInfo(String message)
void logError(String message)
void logError(String message,IBException exception)
void sleep(Integer waitTime)
void exit(String exitMsg)
void setReportParam(String paramName)
void setReportParam(String paramName, Object paramValue)
Object doSmarty(String smartyName,Object data)
QArray toQArray(Object arrayObject)
QData toQData(Object dataObject)
QData toQData(Object dataObject,String keyName)
boolean assertGroup(String groupName, QData qData,boolean recursive)
boolean assertGroup(String groupName, QData qData,String elementType,boolean recursive)
boolean assertGroup(String groupName, String srcArrayElementName, QArray qArray,String elementType,boolean recursive)
void convertToJson(String srcElementName,String destElementName)