Steps and Assertions

Steps and assertions are basic building blocks of autoX. From the basic language (like if, loop, functions etc) to complex/custom functionality everything is done using steps/assertions.
Step is a simple tag, which helps in execution of some functionality.
Assertion is similar to step, which apart from execution of some functionality it also validates the state of current execution.

Common related steps

Assertion assertDeepEquals - assert deep equals

Compares specified values for deep equality. This will not compare the java types, but compares only the structure.

Parameters
Name Type Description
actual java.lang.Object This is an Expression param
Actual value in comparison
checkEquality boolean If false, instead of checking for equlity, check will be done for non equality. Default: true
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
expected java.lang.Object This is an Expression param
Expected value in comparison.
failedPathAttr java.lang.String Failed path, if any, will be set on context with this attribute. Default: failedPath
ignoreExtraProperties boolean If true, extra properties in actual will be ignored and will only ensure expected structure is found in actual object. Default: false

Assertion assertEquals - assert equals

Compares specified values for euqality.

Parameters
Name Type Description
actual java.lang.Object This is an Expression param
Actual value in comparison
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
expected java.lang.Object This is an Expression param
Expected value in comparison.
Examples
1 Any object reference can be used both for expected and actual
<ccg:assert-equals expected="string:value" actual="string:value" />
<ccg:assert-equals expected="int:10" actual="prop: attr.intAttr" />

Assertion assertFalse - assert false

Asserts given value is either boolean false or string 'false'

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
value java.lang.Object This is an Expression param
Value to be evaluated
Examples
1 Using free marker condition in the value
<ccg:assert-false value="condition: attr.intAttr1 gt 5" />
2 Any object reference expression can be used
<ccg:assert-false value="prop: attr.flag" />

Assertion assertFileExists - assert file exists

Validates specified path exists.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
path java.lang.String Path of file to check.
Examples
1 Assert specified file exists
<ccg:assert-file-exists path="test.txt"/>

Assertion assertNotEquals - assert not equals

Compares specified values for non euqality.

Parameters
Name Type Description
actual java.lang.Object This is an Expression param
Actual value in comparison
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
expected java.lang.Object This is an Expression param
Expected value in comparison.
Examples
1 Any object reference expression can be used
<ccg:assert-not-equals expected="int:11" actual="prop:attr.intAttr" />

Assertion assertNotNull - assert not null

Asserts the specified value is not null.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
value java.lang.Object This is an Expression param
Value to check.
Examples
1 Any object reference expression can be used
<ccg:assert-not-null value="attr: intAttr" />

Assertion assertNotSame - assert not same

Asserts specified values are not same reference.

Parameters
Name Type Description
actual java.lang.Object This is an Expression param
Actual value in comparison
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
expected java.lang.Object This is an Expression param
Expected value in comparison.
Examples
1 Any object reference expression can be used
<ccg:assert-not-same expected="prop:attr.intAttr" actual="prop:attr.intAttr1" />

Assertion assertNull - assert null

Asserts the value to be null.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
value java.lang.Object This is an Expression param
Value to check.
Examples
1 Any object reference expression can be used
<ccg:assert-null value="prop:attr.intAttrXyz" />

Assertion assertSame - assert same

Asserts specified values are same reference.

Parameters
Name Type Description
actual java.lang.Object This is an Expression param
Actual value in comparison
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
expected java.lang.Object This is an Expression param
Expected value in comparison.
Examples
1 Any object reference expression can be used
<ccg:assert-same expected="prop:attr.intAttr" actual="prop:attr.intAttr" />

Assertion assertTrue - assert true

Asserts given value is either boolean true or string 'true'

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
value java.lang.Object This is an Expression param
Value to be checked.
Examples
1 Any object reference expression can be used
<ccg:assert-true value="condition: attr.intAttr1 gt 5" />

Step collectionAdd - collection add

Adds the specified value to specified collection

Parameters
Name Type Description
collection java.lang.Object This is an Expression param
Collection expression to which specified value needs to be added.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
value java.lang.Object This is an Expression param
Value expression which needs to be added to specified collection. Default: null (null will be added to specified collection)

Step collectionRemove - collection remove

Removes the specified value / key from specified collection or map

Parameters
Name Type Description
collection java.lang.Object This is an Expression param
Collection or expression from which specified value (or key) needs to be removed.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
value java.lang.Object This is an Expression param
Value (or key) expression which needs to be removed from specified collection. Default: null (null will be removed from specified collection)

Step createTempFile - create temp file

Creates temporary file with specified content.

Parameters
Name Type Description
content java.lang.Object This is an Expression param
Content to be written to the file being created.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
pathAttr java.lang.String Name of the attribute to use to set the generated file path.
prefix java.lang.String Prefix to be used for generated file. Default: temp
suffix java.lang.String Suffix to be used for generated file. Default: .txt

Step executeCommand - execute command

Executes specified OS command.

Parameters
Name Type Description
command java.lang.String Command to be executed.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expectedExitCode java.lang.Integer Expected exit code of command. If specified, exit code will be validated with actual exit code.
name java.lang.String Name of the command, which is used in generating log file. This name will be used to set context attribute with generate log file path.
workingDirectory java.lang.String Directory in which command has to be executed.

Step invokeMethod - invoke method

Executes specified method on specified bean.

Parameters
Name Type Description
deepCloneObject boolean When set to false, object will not be deep cloned. Which means property expressions if any, will be processed only once. Default false
deepCloneParams boolean When set to false, parameters will not be deep cloned. Which means property expressions if any, will be processed only once. Default false
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
isStatic boolean Flag indicating if the method to be invoked is a static method or normal instance method. Defaults: false
method java.lang.String Name of the method to be invoked.
object java.lang.Object Object on which method needs to be invoked. For non-static method this is mandatory
objectType java.lang.Class Object on which method needs to be invoked. For static method this is mandatory
paramTypes java.lang.String List of method argument types delimited by comma. Needs to be used when particular method needs to be invoked. If not specified, method which matches with specified arguments will be invoked.
parameters java.util.List List of parameters to be passed to method.
resultParameter java.lang.String Context parameter name to be used to set the result on context. Default: returnValue

Step log - log

Logs specified message. Multiple messages can be specified in single log statement. If non-string or non-primitive values are specified they are converted to json before printing.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
level com.yukthitech.autox.test.log.LogLevel Logging level. Default Value: DEBUG
message java.util.List This is an Expression param
Message(s)/object(s) to log
Examples
1 Logging simple message at default level (DEBUG)
<ccg:log message="This message is from step group"/>
2 Logging multiple messages and by using expressions
<ccg:log>
    <message>Invoking method using object from app config: </message>
    <message>prop: data.beanFromApp</message>
</ccg:log>
3 Logging at specific level
<ccg:log level="SUMMARY" message="Time taken during test was: 100"/>

Step mapPut - map put

Adds the specified key-value entry to specified map.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
key java.lang.Object This is an Expression param
Key expression which needs to be added to specified collection. Default: null (null will be added)
map java.lang.Object This is an Expression param
Map expression to which specified entry needs to be added.
value java.lang.Object This is an Expression param
Value expression which needs to be added to specified collection. Default: null (null will be added)

Step mkdir - mkdir

Creates a directory with required parent folder as needed in work folder.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
name java.lang.String Context attribute to which result folder path will be set
path java.lang.String Directory path to create.
Examples
1 Creating dir in work folder
<ccg:mkdir path="tmp/test1" name="tmpDir"/>

Step remove - remove

Removes the specified context attribute or values matching with specified path.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expression java.lang.String Expression to be used to remove the values. Currently supported expressions: xpath, attr, store
name java.lang.String Name of the attribute to remove.
Examples
1 Removing context attribute
<ccg:remove name="tmpDir"/>
2 Removing using xpath expression - key in a map.
<ccg:set expression="bean">
    <value>
        json:
        {
            "key1" : "value1",
            "key2" : "value2",
            "arr": [1, 2, 3, 4, 5],
            "strArr": ["one", "two", "three"]
        }
    </value>
</ccg:set>

<ccg:remove expression="xpath: /attr/bean/key2"/>
3 Removing using xpath expression - to remove element in a list using index. Note: In xpath idex starts with 1 (not zero).
<ccg:remove expression="xpath: /attr/bean/arr[2]"/>
4 Removing using xpath expression - to remove element in a list using value.
<ccg:remove expression="xpath: /attr/bean/strArr[contains(., 'two')]"/>

Step sendMail - send mail

Step to send mail, useful to send specific notifications from test cases.

Parameters
Name Type Description
content java.lang.String This is an Expression param
Content to be used for sending mail.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
fromAddress java.lang.String This is an Expression param
Email-Id from which notification should be marked as sent.
password java.lang.String Smtp password to be used for authentication. If not specified, authentication will not be done.
smptpHost java.lang.String This is an Expression param
Smtp host to be used for sending mails
smptpPort java.lang.Integer Smtp port to be used for sending mails.
subject java.lang.String This is an Expression param
Subject to be used for sending mail.
toAddressList java.lang.String This is an Expression param
Space separated address list to which notification should be sent.
ttlsEnabled boolean Flag indicating ttls enabled or not.
userName java.lang.String Smtp user name to be used for authentication. If not specified, authentication will not be done.

Step set - set

Sets the specified value using specified expression

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expression java.lang.String This is an expression-path. This is similar to Expressions, but are generally used to set the value at specified path.
Expression to be used to set the value.
value java.lang.Object This is an Expression param
Value of the attribute to set. Default: empty string
Examples
1 Setting context attribute with type
<ccg:set expression="intAttr" value="int: 10" />
<ccg:set expression="attr(int): intAttr1" value="10"/>
2 Using piped expressions for setting the value
<ccg:set expression="propAttr1" value="file:./src/test/resources/data/data1.json | prop: bean1.prop1"/>
3 Setting property (instead of default context attribute)
<ccg:set expression="prop: attr.beanForTest.key1" value="newValue1" />
4 Setting property using json
<ccg:set expression="beanForTest">
    <value>json:
        {
            "key1" : "value1",
            "key2" : "value2"
        }
    </value>
</ccg:set>

Step sleep - sleep

Sleeps for specified amount of time.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
time java.lang.Long Time to sleep.
timeUnit java.util.concurrent.TimeUnit Units of time specified. Default: millis
Examples
1 Sleep for specified number of millis (default time units)
<ccg:sleep time="5000"/>
2 Sleep using non-default time units
<ccg:sleep time="10" timeUnit="SECONDS"/>

Step startTimer - start timer

Starts time tracking with specified name. Stopping timer would keep elaspsed time on context which can used for logging.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
name java.lang.String Name of the timer.
Examples
1 Starting/stopped timer with specified name
<ccg:start-timer name="timeTaken"/>
<ccg:sleep time="10" timeUnit="SECONDS"/>
<ccg:stop-timer name="timeTaken"/>

Step stopTimer - stop timer

Stops the timer and keeps the elapsed time on context.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
name java.lang.String Name of the timer.
Examples
1 Starting/stopped timer with specified name
<ccg:start-timer name="timeTaken"/>
<ccg:sleep time="10" timeUnit="SECONDS"/>
<ccg:stop-timer name="timeTaken"/>

Lang related steps

Step break - break

Breaks current loop

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
Examples
1 Breaking the loop
<ccg:for start="1" end="20">
    <ccg:if condition="attr.loopVar % 2 != 0">
        <ccg:continue/>
    </ccg:if>
    
    <ccg:set expression="res" value="${attr.res}|${attr.loopVar}"/>
    
    <ccg:if condition="attr.loopVar gte 10">
        <ccg:break/>
    </ccg:if>
</ccg:for>

Step continue - continue

Continues current loop

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false

Step execute - execute

Execute specified expression.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enclose boolean If true, encloses the specified expression in ${}. Default: true
expression java.lang.String Expression to execute.
Examples
1 Executing the expression
<ccg:execute expression="${attr.val + 1}"/>

Step fail - fail

Fails the current test case by throwing fail exception.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
message java.lang.String This is an Expression param
Message ot the fail exception to be thrown
Examples
1 Failing the test case
<ccg:if condition="attr.loopVar % 2 != 0">
    <ccg:fail/>
</ccg:if>

Step for - for

Loops through specified range of values and for each iteration executed underlying steps

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
end java.lang.Object This is an Expression param
Inclusive end of range.
loopVar java.lang.String Loop variable that will be used to set loop iteration object on context. Default: loopVar
start java.lang.Object This is an Expression param
Inclusive start of range.
steps com.yukthitech.autox.test.Function Group of steps/validations to be executed in loop.
Examples
1 Looping through range of numbers
<ccg:for start="1" end="20">
    <ccg:if condition="attr.loopVar % 2 != 0">
        <ccg:continue/>
    </ccg:if>
    
    <ccg:set expression="res" value="${attr.res}|${attr.loopVar}"/>
</ccg:for>

Step forEach - for each

Loops through specified collection, map or string tokens and for each iteration executed underlying steps

Parameters
Name Type Description
delimiter java.lang.String If expression evaluated to string, delimiter to be used to split the string. Default Value: comma (\s*\,\s*)
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expression java.lang.Object This is an Expression param
Expression which will be evaluated to collection or map or String
ignoreError boolean Ignores error during iteration and continues to next iteration.
loopIdxVar java.lang.String Loop index variable that will be used to set loop iteration index on context. Default: loopIdxVar
loopVar java.lang.String Loop variable that will be used to set loop iteration object on context. Default: loopVar
steps com.yukthitech.autox.test.Function Group of steps/validations to be executed in loop.
Examples
1 Looping through list elements
<ccg:for-each expression="attr: checkBoxes" loopVar="cbox">
    <ccg:set expression="values" value="${attr.values},${uiElemAttr('value', attr.cbox, null)}"/>
</ccg:for-each>
2 Looping through string tokens using delimter
<ccg:for-each expression="string: a,b,c,d, e,f" delimiter="\s*\,\s*">
    <ccg:if condition="attr.loopVar == 'b'">
        <ccg:continue/>
    </ccg:if>
    
    <ccg:set expression="res" value="${attr.res}|${attr.loopVar}"/>
</ccg:for-each>

Step function - function

Creates custom function for reusability which can be invoked from other places.

Parameters
Name Type Description
description java.lang.String Description of the function
name java.lang.String Name of the function
returnDescription java.lang.String Return description of the function. If not specified, function is assumed will not return any value

Step functionRef - function ref

Reference step to execute target function with specified parameters.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
name java.lang.String Name of the function to execute.
params java.util.Map Parameters to be passed to function.
returnAttr java.lang.String Attribute name to be used to specify return value. If not specified, return value will be ignored. Default: null

Step if - if

Evaluates specified condition and if evaluates to true execute 'then' otherwise execute 'else'. For ease 'if' supports direct addition of steps which would be added to then block.

Parameters
Name Type Description
condition java.lang.String This is a "Condition" parameter. This is a freemarker expression that should result in boolean value.
Freemarker condition to be evaluated.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
else com.yukthitech.autox.test.Function Group of steps/validations to be executed when condition evaluated to be false.
then com.yukthitech.autox.test.Function Group of steps/validations to be executed when condition evaluated to be true.
Examples
1 If to check condition and execute steps
<ccg:if condition="attr.loopVar % 2 != 0">
    <ccg:continue/>
</ccg:if>
2 If with else block
<ccg:if condition="attr.flag == 1">
    <then>
        <ccg:set expression="ifExec" value="if-then"/>
    </then>
    <else>
        <ccg:set expression="ifExec" value="if-else"/>
    </else>
</ccg:if>

Assertion pollAndCheck - poll and check

Used to execute polling steps till check condition is met with specified interval gap. Validation will fail if required condition is not met or exceeds timeout.

Parameters
Name Type Description
checkCondition java.lang.String This is a "Condition" parameter. This is a freemarker expression that should result in boolean value.
Check Freemarker condition to be evaluated.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
poll com.yukthitech.autox.test.Function Group of steps/validations to be executed as part of polling.
pollingInterval java.lang.Long Polling interval duration.
pollingIntervalUnit java.util.concurrent.TimeUnit Polling interval time unit. Defaults to millis.
timeOut java.lang.Long Timout till which check condition will be tried. After this time, this validation will fail.
timeOutUnit java.util.concurrent.TimeUnit Time out time unit. Defaults to millis.
Examples
1 Polling and checking for condition
<ccg:pollAndCheck checkCondition="attr.checkVar gte 5" timeOut="20" timeOutUnit="SECONDS" pollingInterval="500">
    <poll>
        <ccg:set expression="checkVar" value="int: ${attr.checkVar + 1}"/>
    </poll>
</ccg:pollAndCheck>

Step return - return

Returns from current execution. Currently this is supported only in step-group.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
value java.lang.Object This is an Expression param
Value to be returned.
Examples
1 Returning from a step group
<step-group name="condSimpleGroup">
    <ccg:if condition="attr.returnFlag??">
        <ccg:set expression="ifExec">
            <value>string: returnFlag: ${attr.returnFlag}</value>
        </ccg:set>
        
        <ccg:return/>
    </ccg:if>
</step-group>

Step while - while

Loops till specified condition is evaluated to true executed underlying steps

Parameters
Name Type Description
condition java.lang.String This is a "Condition" parameter. This is a freemarker expression that should result in boolean value.
Freemarker condition to be evaluated.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
steps com.yukthitech.autox.test.Function Group of steps/validations to be executed in loop.
Examples
1 Looping till condition is meeting
<ccg:while condition="attr.i lt 5">
    <ccg:set expression="res" value="${attr.res}|${attr.i}"/>
    <ccg:set expression="i" value="int: ${attr.i + 1}"/>
</ccg:while>

Mock related steps

Step mockFetchRequest - mock fetch request

Fetches mock request details with specified filter details

Parameters
Name Type Description
attributeName java.lang.String Attribute name to be used to store filtered-request on context.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
methodFilter java.lang.String This is an Expression param
Method filter to be used to fetch mock request.
name java.lang.String Name of the server.
uriFilter java.lang.String This is an Expression param
Uri filter to be used to fetch mock request.
Examples
1 Fetching mock requests received on specified mock-server (from last reser or start) with specified request filter criteria. Below example fetches POST requests from "testMockServer" for uri "/test/job"
<s:mock-fetch-request name="testMockServer" attributeName="mockRequests" uriFilter="/test/job" methodFilter="POST"/>

Step mockResponse - mock response

Mocks the specified request (url + method) with specified response.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
method java.lang.String This is an Expression param
Http method of the request to be mocked
name java.lang.String This is an Expression param
Name of the server where mocking should be done.
responseBody java.lang.String This is an Expression param
Body of the mocked response
responseHeader java.util.Map Headers to be added to the mock response
responseStatusCode java.lang.Integer This is an Expression param
Status code to be sent as part of mock response
times int Number of times for which response should be available for given request. Default: Integer max value
uri java.lang.String This is an Expression param
Request uri to be mocked
waitConfig com.yukthitech.autox.test.proxy.steps.WaitConfig Wait configuration to be used before sending response.
Examples
1 Mocking a response for a POST api
<s:mock-response method="POST" name="testMockServer" responseStatusCode="200" uri="/test/job">
    <response-header name="Content-Type">application/json</response-header>

    <responseBody>
        {
            "code" : 0,
            "message": "some test message from response"
        }
    </responseBody>
</s:mock-response>

Step mockServerReset - mock server reset

Resets specified mock server, that is cleaning up all mocked responses and requests..

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
name java.lang.String This is an Expression param
Name of the server.
Examples
1 Reseting the mock server, that is cleaning up all mocked responses and requests.
<s:mock-server-reset name="testMockServer"/>

Step mockServerStart - mock server start

Starts Mock Server with specified name and port

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
name java.lang.String This is an Expression param
Name of the server.
port java.lang.String This is an Expression param
Port Number on which mock server has to start
Examples
1 Starting mock server with specified name at specified port
<s:mock-server-start name="testMockServer" port="9944"/>

Step mockServerStop - mock server stop

Stops specified mock server.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
name java.lang.String This is an Expression param
Name of the server.
Examples
1 Stopping specified mock server.
<s:mock-server-stop name="testMockServer"/>

Mongodb related steps

Assertion assertMongo - assert mongo

Executes specified mongo Query on specified mongo resource. Syntax of queries can be found at https://docs.mongodb.com/manual/reference/command. And the result is deep-compared with specified expecte object. Extra properties from result are ignored.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
expected java.lang.Object This is an Expression param
Expected value in comparison.
mongoResourceName java.lang.String Mongo Resource to be used for query execution.
query java.lang.String Query to execute.

Step mongoMultiQuery - mongo multi query

Executes specified multiple mongo Query on specified mongo resource. Syntax of queries can be found at https://docs.mongodb.com/manual/reference/command.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
mongoResourceName java.lang.String Mongo Resource to be used for query execution.
queries java.util.List Query(ies) to execute.

Step mongoQuery - mongo query

Executes specified mongo Query on specified mongo resource. Syntax of queries can be found at https://docs.mongodb.com/manual/reference/command.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
mongoResourceName java.lang.String Mongo Resource to be used for query execution.
query java.lang.String Query to execute.
resultAttribute java.lang.String Name of the attribute to be used to set the result.

Rdbms related steps

Assertion sqlAssert - sql assert

Executes specified query and validates expected data is returned

Parameters
Name Type Description
dataSourceName java.lang.String Name of the data source to be used for query execution.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
expectedRows java.util.List Expected rows of values from query result. Each row will have list of column (name-value pairs)
query java.lang.String Query to execute whose results needs to be validated.

Assertion sqlAssertValue - sql assert value

Executes specified query and validates only single value (first row - first column value)

Parameters
Name Type Description
convertExpression java.lang.String Expression to be used on query result, before comparision. Default: null
dataSourceName java.lang.String Name of the data source to be used for query execution.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
expectedValue java.lang.Object This is an Expression param
Expected value. Which will compared with value from db.
query java.lang.String Query to execute whose results needs to be validated.

Step sqlDdlQuery - sql ddl query

Executes specified DDL query on specified data source.

Parameters
Name Type Description
dataSourceName java.lang.String Data source to be used for sql execution.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
query java.lang.String DDL query to execute

Step sqlDmlQuery - sql dml query

Executes specified DML Query on specified data source.

Parameters
Name Type Description
commitAtEnd boolean If true, calls commit at end. Default: true
countAttribute java.lang.String If specified, number of rows affected will be set on the context
dataSourceName java.lang.String Data source to be used for sql execution.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
failOnNoUpdate boolean If true, error will be thrown if no rows are affected by specified DML. Default Value: false
query java.lang.String Query to execute.

Step sqlFetchValueQuery - sql fetch value query

Fetches single value (first row, first column value) from the results of specified query.

Parameters
Name Type Description
contextAttribute java.lang.String Name of the attribute which should be used to keep the result value.
dataSourceName java.lang.String Name of the data source to be used for query execution.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
query java.lang.String Query to execute, the result's first column will be used to create list.

Step sqlLoadQueryColumnList - sql load query column list

Executes specified query and loads the result first column values as list on the context. In case of zero results empty list will be kept on context.

Parameters
Name Type Description
contextAttribute java.lang.String Name of the attribute which should be used to keep the result map on the context.
dataSourceName java.lang.String Name of the data source to be used for query execution.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
query java.lang.String Query to execute, the result's first column will be used to create list.

Step sqlLoadQueryMap - sql load query map

Executes specified query and loads the results as map on context. In case of zero results empty map will be kept on context. Per row new entry will be added.

Parameters
Name Type Description
contextAttribute java.lang.String Name of the attribute which should be used to keep the result map on the context.
dataSourceName java.lang.String Name of the data source to be used for query execution.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
keyColumn java.lang.String Results column name whose values should be used as key in result map.
query java.lang.String Query to execute, the results will be used to create map.
valueColumn java.lang.String Results column name whose values should be used as value in result map.

Step sqlLoadQueryRowBean - sql load query row bean

Executes specified query and loads the results as bean(s) on context. In case of zero results empty map will be kept on context. Per row new bean will be created.

Parameters
Name Type Description
beanType java.lang.Class Type of bean to which rows should be converted.
contextAttribute java.lang.String Name of the attribute which should be used to keep the result bean on the context.
dataSourceName java.lang.String Name of the data source to be used for query execution.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
processAllRows boolean If false, only first row will be processed into bean. If true, per row new map will be created and loads of this beans into context. Default: true
query java.lang.String Query to execute, the results will be used to create bean.

Step sqlLoadQueryRowMap - sql load query row map

Executes specified query and loads the results as map(s) on context. In case of zero results empty map will be kept on context. Per row new map will be created.

Parameters
Name Type Description
contextAttribute java.lang.String Name of the attribute which should be used to keep the result map on the context.
dataSourceName java.lang.String Name of the data source to be used for query execution.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
processAllRows boolean If false, only first row will be processed into map. If true, per row new map will be created and loads of this maps into context. Default: true
query java.lang.String Query to execute, the results will be used to create map.

Step sqlMultiDmlQuery - sql multi dml query

Executes specified multiple DML queries in single transaction

Parameters
Name Type Description
dataSourceName java.lang.String Data source to be used for sql execution.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
failOnNoUpdate boolean If true, error will be thrown if no rows are affected by specified DML. Default Value: false

Rest_Api related steps

Step restInvokeDelete - rest invoke delete

Used to invoke DELETE api.

Parameters
Name Type Description
baseUrl java.lang.String Base url to be used. If specified, this will be used instead of using base url from plugin.
contentType java.lang.String Request content type to be used. default: application/json
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expectedResponseType java.lang.Class Expected response type. Default: java.lang.Object
responseContextAttribure java.lang.String Context attribute name on which the actaul rest response object will be placed. default: response
resultContextAttribute java.lang.String Context attribute name on which result object will be placed, which can be used to fetch status code. Result will have following properties:
1. statusCode (int) - Http status code obtained from the rest call
2. value (object) - the response object (this can be accessed using 'responseContextAttribure' directly3. headers (Map<String, List<String>>) - Response header. Note: a header can have multiple values.
default: result
uri java.lang.String Uri to be invoked.
Examples
1 Invoking delete api
<ccg:rest-invoke-delete uri="/emp/delete/{id}">
    <pathVariable name="id">${attr.emp2_id}</pathVariable>
</ccg:rest-invoke-delete>

Step restInvokeGet - rest invoke get

Used to invoke GET api.

Parameters
Name Type Description
baseUrl java.lang.String Base url to be used. If specified, this will be used instead of using base url from plugin.
contentType java.lang.String Request content type to be used. default: application/json
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expectedResponseType java.lang.Class Expected response type. Default: java.lang.Object
responseContextAttribure java.lang.String Context attribute name on which the actaul rest response object will be placed. default: response
resultContextAttribute java.lang.String Context attribute name on which result object will be placed, which can be used to fetch status code. Result will have following properties:
1. statusCode (int) - Http status code obtained from the rest call
2. value (object) - the response object (this can be accessed using 'responseContextAttribure' directly3. headers (Map<String, List<String>>) - Response header. Note: a header can have multiple values.
default: result
uri java.lang.String Uri to be invoked.
Examples
1 Invoking get api
<ccg:rest-invoke-get uri="/emp/get/{id}">
    <pathVariable name="id">${attr.emp2_id}</pathVariable>
</ccg:rest-invoke-get>

Step restInvokeGetFile - rest invoke get file

Used to invoke GET api and save response as file.

Parameters
Name Type Description
baseUrl java.lang.String Base url to be used. If specified, this will be used instead of using base url from plugin.
contentType java.lang.String Request content type to be used. default: application/json
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expectedResponseType java.lang.Class Expected response type. Default: java.lang.Object
outputFile java.lang.String Output file where response content should be stored. If not specified, temp file will be used. The output file path will be set response attribute
responseContextAttribure java.lang.String Context attribute name on which the actaul rest response object will be placed. default: response
resultContextAttribute java.lang.String Context attribute name on which result object will be placed, which can be used to fetch status code. Result will have following properties:
1. statusCode (int) - Http status code obtained from the rest call
2. value (object) - the response object (this can be accessed using 'responseContextAttribure' directly3. headers (Map<String, List<String>>) - Response header. Note: a header can have multiple values.
default: result
uri java.lang.String Uri to be invoked.
Examples
1 Invoking get api to download file
<ccg:rest-invoke-get-file uri="/emp/getFile/{id}">
    <pathVariable name="id">${attr.emp3_id}</pathVariable>
</ccg:rest-invoke-get-file>

<ccg:set expression="outputContent" value="file(text=true): ${attr.response}"/>

Step restInvokeMultipartPost - rest invoke multipart post

Used to invoke Multipart POST api.

Parameters
Name Type Description
baseUrl java.lang.String Base url to be used. If specified, this will be used instead of using base url from plugin.
contentType java.lang.String Request content type to be used. default: application/json
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expectedResponseType java.lang.Class Expected response type. Default: java.lang.Object
responseContextAttribure java.lang.String Context attribute name on which the actaul rest response object will be placed. default: response
resultContextAttribute java.lang.String Context attribute name on which result object will be placed, which can be used to fetch status code. Result will have following properties:
1. statusCode (int) - Http status code obtained from the rest call
2. value (object) - the response object (this can be accessed using 'responseContextAttribure' directly3. headers (Map<String, List<String>>) - Response header. Note: a header can have multiple values.
default: result
uri java.lang.String Uri to be invoked.
Examples
1 Invoking post api with attachment
<ccg:rest-invoke-multipart-post uri="/emp/saveWithFile">
    <part name="details">
        <value>
            {
                "name" : "Emp3",
                "address": "some address"
            }
        </value>
    </part>
    
    <attachment name="file" file="file:./src/test/resources/testFile.txt"/>                
</ccg:rest-invoke-multipart-post>

Step restInvokeMultipartPut - rest invoke multipart put

Used to invoke Multipart PUT api.

Parameters
Name Type Description
baseUrl java.lang.String Base url to be used. If specified, this will be used instead of using base url from plugin.
contentType java.lang.String Request content type to be used. default: application/json
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expectedResponseType java.lang.Class Expected response type. Default: java.lang.Object
responseContextAttribure java.lang.String Context attribute name on which the actaul rest response object will be placed. default: response
resultContextAttribute java.lang.String Context attribute name on which result object will be placed, which can be used to fetch status code. Result will have following properties:
1. statusCode (int) - Http status code obtained from the rest call
2. value (object) - the response object (this can be accessed using 'responseContextAttribure' directly3. headers (Map<String, List<String>>) - Response header. Note: a header can have multiple values.
default: result
uri java.lang.String Uri to be invoked.
Examples
1 Invoking put api with attachment
<ccg:rest-invoke-multipart-put uri="/emp/updateWithFile">
    <part name="details">
        <value>
            {
                "name" : "Emp3",
                "address": "some address"
            }
        </value>
    </part>
    
    <attachment name="file" file="file:./src/test/resources/testFile.txt"/>                
</ccg:rest-invoke-multipart-put>

Step restInvokePost - rest invoke post

Used to invoke POST api.

Parameters
Name Type Description
baseUrl java.lang.String Base url to be used. If specified, this will be used instead of using base url from plugin.
body java.lang.Object This is an Expression param
Body to be set. If non-string is specified, object will be converted to json and content-type header will be set as JSON.
contentType java.lang.String Request content type to be used. default: application/json
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expectedResponseType java.lang.Class Expected response type. Default: java.lang.Object
responseContextAttribure java.lang.String Context attribute name on which the actaul rest response object will be placed. default: response
resultContextAttribute java.lang.String Context attribute name on which result object will be placed, which can be used to fetch status code. Result will have following properties:
1. statusCode (int) - Http status code obtained from the rest call
2. value (object) - the response object (this can be accessed using 'responseContextAttribure' directly3. headers (Map<String, List<String>>) - Response header. Note: a header can have multiple values.
default: result
uri java.lang.String Uri to be invoked.
Examples
1 Invoking post api
<ccg:rest-invoke-post uri="/emp/save">
    <body>
        {
            "name" : "Emp2",
            "address": "some address"
        }
    </body>
</ccg:rest-invoke-post>

<ccg:set expression="emp2_id" value="attr: response | xpath: //id"/>
<s:assert-equals actual="prop: attr.result.statusCode" expected="int: 200"/>
2 Invoking post api as a Form
<ccg:rest-invoke-post uri="/emp/saveForm">
    <param name="name">Emp1</param>
    <param name="address">some address</param>
</ccg:rest-invoke-post>

Step restInvokePut - rest invoke put

Used to invoke PUT api.

Parameters
Name Type Description
baseUrl java.lang.String Base url to be used. If specified, this will be used instead of using base url from plugin.
body java.lang.Object This is an Expression param
Body to be set. If non-string is specified, object will be converted to json and content-type header will be set as JSON.
contentType java.lang.String Request content type to be used. default: application/json
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expectedResponseType java.lang.Class Expected response type. Default: java.lang.Object
responseContextAttribure java.lang.String Context attribute name on which the actaul rest response object will be placed. default: response
resultContextAttribute java.lang.String Context attribute name on which result object will be placed, which can be used to fetch status code. Result will have following properties:
1. statusCode (int) - Http status code obtained from the rest call
2. value (object) - the response object (this can be accessed using 'responseContextAttribure' directly3. headers (Map<String, List<String>>) - Response header. Note: a header can have multiple values.
default: result
uri java.lang.String Uri to be invoked.
Examples
1 Invoking put api
<ccg:rest-invoke-put uri="/emp/update">
    <body>
        {
            "name" : "Emp2",
            "address": "some address"
        }
    </body>
</ccg:rest-invoke-put>

Ssh related steps

Step sshCloseSession - ssh close session

Closes the specified remote session.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
session java.lang.String Name of the session to be closed.

Step sshExecuteCommand - ssh execute command

Executes specified command on specified session and stores the output on context.

Parameters
Name Type Description
command java.lang.String Command to be executed.
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
exitStatusVar java.lang.String Name of the context attribute on which exit status to be set. Default: exitStatus
outputVar java.lang.String Name of the output context attribute on which output needs to be set. Default: output
session java.lang.String Name of the session on which command needs to be executed.

Step sshStartSession - ssh start session

Starts a new session with specified details. The session can be accessed in other ssh steps with specified name.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
host java.lang.String Remote host to be connected.
name java.lang.String Name for the session being started.
password java.lang.String Password for login. Either of password or private-key is mandatory. If both are provided, password will be given higher preference.
port int Remote host's ssh port. Default: 22
privateKeyPath java.lang.String Private key to be used for login. Either of password or private-key is mandatory. If both are provided, password will be given higher preference.
user java.lang.String User name for login.

Store related steps

Step storeDelete - store delete

Deletes value from store for specified key.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
key java.lang.String Key to be deleted.

Ui related steps

Assertion uiAssertFormFields - ui assert form fields

Validates specified form fields are present

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
locator java.lang.String This is a UI locator param.
Locator of the form to be validated.

Assertion uiAssertValue - ui assert value

Validates specified element has specified value/text

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
locator java.lang.String This is a UI locator param.
Locator of the element to be validated.
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
value java.lang.String Expected value of the element.

Assertion uiAssertVisibility - ui assert visibility

Validates specified element is visible/hidden

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
enabled java.lang.String Enables/disables current validation. Default: true
locator java.lang.String This is a UI locator param.
Locator of the element to validate
message java.lang.String Message expected in the target element.
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
visible java.lang.String Flag indicating if the validation is for visibility or invisibility. Default: true
Examples
1 Asserts the visibility of ui element
<ccg:ui-assert-visibility locator="id: downloadLink"/>

Step uiClick - ui click

Clicks the specified target

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
locator java.lang.String This is a UI locator param.
Locator of the element to be clicked. Out of located elements, first element will be clicked.
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
postHideLocator java.lang.String This is a UI locator param.
Post click the locator to be used to check for hidden. If this locator is visible, click will be retried till this locator is visible or timeout. Note: Polling for visibility will be done every 100 millis.
postVerificationDelay int Time to wait to perform post verification in millis. Default: 2000
postVisibilityLocator java.lang.String This is a UI locator param.
Post click the locator to be used to check for visibility. If this locator is not visible, click will be retried till this locator is visible or timeout. Note: Polling for visibility will be done every 100 millis.
Examples
1 Click the element using locator
<ccg:ui-click locator="id: button"/>

Step uiClickAndDownload - ui click and download

Clicks the specified target and download the result file. If no file is downloaded, this will throw exception.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
downloadWaitTime long Time to wait for download to complete in millis. Default: 30000
locator java.lang.String This is a UI locator param.
Locator of the element to be triggered. Out of located elements, first element will be clicked.
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
pathName java.lang.String Attribute name which would be set with the downloaded file path.
Examples
1 Clicks a link in ui to download file
<ccg:ui-click-and-download locator="id: downloadLink" pathName="filePath"/>

Step uiCloseSession - ui close session

Closes the current browser window.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false

Step uiCloseWindow - ui close window

Closes the current window.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
Examples
1 Click the element using locator
<ccg:ui-open-window url="/index.html" name="Index"/>
<ccg:ui-switch-window locator="Index"/>
<ccg:ui-is-visible locator="id: button" name="visibFlag1"/>
<ccg:ui-close-window />

Step uiDblClick - ui dbl click

Double Clicks the specified target

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
locator java.lang.String This is a UI locator param.
Locator of the element to be double-cicked.
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
postHideLocator java.lang.String This is a UI locator param.
Post click the locator to be used to check for hidden. If this locator is visible, click will be retried till this locator is visible or timeout. Note: Polling for visibility will be done every 100 millis.
postVerificationDelay int Time to wait to perform post verification in millis. Default: 2000
postVisibilityLocator java.lang.String This is a UI locator param.
Post click the locator to be used to check for visibility. If this locator is not visible, click will be retried till this locator is visible or timeout. Note: Polling for visibility will be done every 100 millis.

Step uiDragAndDrop - ui drag and drop

Drags the specified element to specified target

Parameters
Name Type Description
destination java.lang.String Locator of element on which source element should be dropped
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
source java.lang.String Locator of element which needs to be dragged

Step uiExecuteJs - ui execute js

Can be used to execute js code

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
resultAttribute java.lang.String If specified, the result of the js execution (returned by 'return' statement) will be stored with this name on context. Default: null
script java.lang.String Script to execute

Step uiFillForm - ui fill form

Fills the form with specified data

Parameters
Name Type Description
data java.lang.Object This is an Expression param
Data to populate in the form
delay int Delay in millis time between field to field filling. Useful in forms, in which field options are fetched based on other field values. Default: 10
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
locator java.lang.String This is a UI locator param.
Html locator of the form or container (like DIV) enclosing the input elements

Step uiGetElements - ui get elements

Fetches value of specified ui element

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
locator java.lang.String This is a UI locator param.
Locator of the elements to be fetched
name java.lang.String Name of the attribute to set.
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
Examples
1 Getting elements using locator
<ccg:ui-get-elements locator="xpath: //input[@type='checkbox']" name="checkBoxes"/>

<ccg:forEach expression="attr.checkBoxes" loopVar="cbox">
    <ccg:set expression="values" value="${attr.values},${uiElemAttr('value', attr.cbox, null)}"/>
</ccg:forEach>

Step uiGetNewWindowHandle - ui get new window handle

Used to fetch newly opened window handle.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
name java.lang.String Name by which window can be accessed.

Step uiGetValue - ui get value

Fetches value of specified ui element

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
displayValue boolean If set to true, instead of value display value will be fetched (currently non-select fields will return value itself).
locator java.lang.String This is a UI locator param.
Locator of the element for which value needs to be fetched
name java.lang.String Name of the attribute to set.
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
Examples
1 Getting value of specified locator
<ccg:ui-get-value locator="xpath: //input[@name='statusFld']" name="fldValue"/>

Step uiGotoPage - ui goto page

Loads page with specified uri

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
uri java.lang.String URI of the page to load
Examples
1 Filling html form
<ccg:ui-goto-page uri="/index.html" />

Step uiGotoUrl - ui goto url

Loads page with specified url

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
url java.lang.String URL of the page to load

Step uiHandleAlert - ui handle alert

Used to validate and click ok of alert prompt.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expectedMessage java.lang.String Messaged expected in alert. If specified, alert message will be validated with this message.

Step uiHandleConfirm - ui handle confirm

Used to validate and click ok/cancel of confirm prompt.

Parameters
Name Type Description
accept boolean Flag used to accept or cancel confirm box. Default: true
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expectedMessage java.lang.String Messaged expected in alert. If specified, alert message will be validated with this message.

Step uiHandlePrompt - ui handle prompt

Used to validate, feed and accept/cancel prompt.

Parameters
Name Type Description
accept boolean Flag used to accept or cancel confirm box. Default: true
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
expectedMessage java.lang.String Messaged expected in alert. If specified, alert message will be validated with this message.
text java.lang.String If specified, feeds the specified text to the prompt

Step uiIsVisible - ui is visible

Fetches flag indicating if target element is visible or not

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
locator java.lang.String This is a UI locator param.
Locator of the element for which value needs to be fetched
name java.lang.String Name of the attribute to set.
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
Examples
1 Checking for visibility of element
<ccg:ui-is-visible locator="id: testLayer" name="visibFlag1"/>

Step uiLoadCookies - ui load cookies

Loads cookies from specified file into current session cookies.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
path java.lang.String Path of the file where cookies should be loaded from. Default: ./cookies.ser

Step uiLogScreenShot - ui log screen shot

Takes current screen snapshot and adds to the log

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
level com.yukthitech.autox.test.log.LogLevel Logging level. Default Value: DEBUG
message java.lang.String Message to be logged along with image
name java.lang.String Name of the screenshot image file to be created
Examples
1 Taking screen shot of the screen
<ccg:ui-log-screen-shot name="test.png" />

Step uiMoveMouse - ui move mouse

Moves the mouse to specified target and optionally clicks the element.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
xoffset int Mouse mouse in x-direction by specified amount.
yoffset int Mouse mouse in y-direction by specified amount.

Step uiMoveTo - ui move to

Moves the mouse to specified target and optionally clicks the element.

Parameters
Name Type Description
alignToTop boolean Before moving the element, the element will be aligned to document. This flag indicates if alignment should be to top or bottom. Default: true
click boolean If true, moves the mouse to target and clicks the element. Default: false
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
locator java.lang.String This is a UI locator param.
Locator of the element to which mouse needs to be moved. Out of located elements, first element will be clicked.
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
timeGap long Time gap (in millis) which will be used before clicking and after moving the mouse over the element. Default: 10

Step uiOpenWindow - ui open window

Opens new window with specifie name and url.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
name java.lang.String Name of the window being opened.
url java.lang.String Url to be opened.
Examples
1 Opening a new window
<ccg:ui-open-window url="/index.html" name="Index"/>
<ccg:ui-switch-window locator="Index"/>
<ccg:ui-is-visible locator="id: button" name="visibFlag1"/>
<ccg:ui-close-window />

Step uiQuitSession - ui quit session

Quits the driver. In order to user driver again it has to be initialized.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false

Step uiRefresh - ui refresh

Refreshes the current page.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
postHideLocator java.lang.String This is a UI locator param.
Post click the locator to be used to check for hidden. If this locator is visible, click will be retried till this locator is visible or timeout. Note: Polling for visibility will be done every 100 millis.
postVerificationDelay int Time to wait to perform post verification in millis. Default: 2000
postVisibilityLocator java.lang.String This is a UI locator param.
Post click the locator to be used to check for visibility. If this locator is not visible, click will be retried till this locator is visible or timeout. Note: Polling for visibility will be done every 100 millis.

Step uiResetSession - ui reset session

Resets the driver for usage.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false

Step uiRightClick - ui right click

Right clicks the specified target

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
locator java.lang.String This is a UI locator param.
Locator of the element to be triggered. Out of located elements, first element will be clicked.
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.

Step uiSetStyle - ui set style

Used to manipulate the style of the element.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
locator java.lang.String This is a UI locator param.
Locator of the element whose style needs to be modified.
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
styles java.util.Map Styles to be modified.

Step uiSetValue - ui set value

Populates specified field with specified value

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
locator java.lang.String This is a UI locator param.
Locator of the element to be populated
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
pressEnterAtEnd boolean If true, an enter-key press will be simulated on target element after populating value. Default: false
value java.lang.String Value to be filled with. Defaults to empty string.
Examples
1 Setting value of element with specified locator
<ccg:ui-set-value locator="xpath: //input[@name='statusFld']" value="OPEN"/>

Step uiStoreCookies - ui store cookies

Stores the current session cookies into specified file.

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
path java.lang.String Path of the file where cookies should be persisted. Default: ./cookies.ser

Step uiSwitchFrame - ui switch frame

Helps in switching the frames

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
index java.lang.Integer Index of the frame. Either locator or index is mandatory.
locator java.lang.String Locator of the frame. Either locator or index is mandatory.

Step uiSwitchWindow - ui switch window

Helps in switching between windows

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
locator java.lang.String Locator of the window. If none is specified, main window will be selected.
newWindow boolean If no locator is specified and this flag is true, switch would be done to newly opened window. New window is determined based on previous SyncWindowHandles invocation (or window other than main window). If no new window is found, an exception would be thrown. Default: false

Step uiSyncWindowHandles - ui sync window handles

Syncs the current open window handles to context. Which can be used to identify

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false

Step uiWaitFor - ui wait for

Waits for (at least one) specified element to become visible/hidden

Parameters
Name Type Description
disableLogging boolean Flag indicating if logging has to be disabled for current step. Default: false
gapTime int Gap time in millis to wait for between each check. Default: 1000
hidden java.lang.String If true, this step waits for element with specified locator gets removed or hidden. Default: false
locators java.util.List This is a UI locator param.
Locator(s) of the element to be waited for
parentElement java.lang.String Name of the parent element under which locator needs to be searched. If not specified, fetches globally.
waitTime int Total wait time in millis for element to become visible or hidden. Default: 60000

Free Marker Methods

Defines the steps of autox for all functionalities

Free Marker Method - addDays

Adds specified number of days to specified date

Parameters
Name Type Description
date java.util.Date Date to which days should be added
days int Days to be added.
Return Details
Type java.util.Date Description Resultant date after addition of specified days

Free Marker Method - addHours

Adds specified number of hours to specified date

Parameters
Name Type Description
date java.util.Date Date to which hours should be added
hours int Hours to be added.
Return Details
Type java.util.Date Description Resultant date after addition of specified hours

Free Marker Method - addMinutes

Adds specified number of minutes to specified date

Parameters
Name Type Description
date java.util.Date Date to which minutes should be added
minutes int Minutes to be added.
Return Details
Type java.util.Date Description Resultant date after addition of specified minutes

Free Marker Method - addSeconds

Adds specified number of seconds to specified date

Parameters
Name Type Description
date java.util.Date Date to which seconds should be added
seconds int Seconds to be added.
Return Details
Type java.util.Date Description Resultant date after addition of specified seconds

Free Marker Method - collectionToString

Converts collection of objects into string.

Parameters
Name Type Description
lst java.util.Collection Collection to be converted
prefix java.lang.String Prefix to be used at start of coverted string
delimiter java.lang.String Delimiter to be used between the collection elements
suffix java.lang.String Suffix to be used at end of converted string
emptyString java.lang.String String to be used when input list is null or empty
Return Details
Type java.lang.String Description Converted string
Examples
1 collectionToString(lst, '[', ' | ', ']', '')
[a | b | c]
2 collectionToString(null, '[', ' | ', ']', '')
<empty>

Free Marker Method - compare

Compares the specified values and returns the comparision result as int.

Parameters
Name Type Description
value1 java.lang.Object Value1 to compare
value2 java.lang.Object Value2 to compare
Return Details
Type int Description Comparision result.

Free Marker Method - compareAndGet

Used to compare specified attribute with specified value and return appropiate result.

Parameters
Name Type Description
name java.lang.String Name of the attribute to check
value java.lang.String Expected value of the attribute
trueVal java.lang.String Value to be returned when the attribute value match with specified value
falseVal java.lang.String Value to be returned when the attribute value DOES NOT match with specified value
Return Details
Type java.lang.String Description True or false value based on match.

Free Marker Method - countOfXpath

Fetches the count of values matching with specified xpath from specified source object.

Parameters
Name Type Description
source java.lang.Object Source object on which xpath should be evaluated
xpath java.lang.String Xpath to be evaluated
Return Details
Type int Description Number of values matching with specified xpath

Free Marker Method - dateToStr

Converts specified date into string in specified format.

Parameters
Name Type Description
date java.util.Date Date to be converted
format java.lang.String Date format to which date should be converted
Return Details
Type java.lang.String Description Fromated date string.
Examples
1 dateToStr(date, 'MM/dd/yyy')
20/20/2018

Free Marker Method - escape

Removes special characters and coverts result into json string (enclosed in double quotes)

Parameters
Name Type Description
str java.lang.String String to be converted
Return Details
Type java.lang.String Description Converted string

Free Marker Method - fullPath

Converts input file path (Can be relative, partial path) to full canonical path.

Parameters
Name Type Description
path java.lang.String Path to be converted
Return Details
Type java.lang.String Description Canonical path of the specified path

Free Marker Method - getValueByXpath

Fetches the value for specified xpath from specified source object.

Parameters
Name Type Description
source java.lang.Object Source object on which xpath needs to be evaluated
xpath java.lang.String Xpath to be evaluated
Return Details
Type java.lang.Object Description Value of specified xpath

Free Marker Method - getValuesByXpath

Fetches the value(s) list for specified xpath from specified source object.

Parameters
Name Type Description
source java.lang.Object Source object on which xpath needs to be evaluated
xpath java.lang.String Xpath to be evaluated
Return Details
Type java.util.List Description Value of specified xpath

Free Marker Method - ifNull

If 'nullCheck' is null, 'ifNull' will be returned otherwise 'ifNotNull' will be returned.

Parameters
Name Type Description
nullCheck java.lang.Object object to be checked for null
ifNull java.lang.Object object to be returned if null
ifNotNull java.lang.Object object to be returned if not null
Return Details
Type java.lang.Object Description ifNull or ifNotNull based on nullCheck.

Free Marker Method - indexOf

Finds the first index of specified substring in specified string.

Parameters
Name Type Description
string java.lang.String String in which substring needs to be searched
substr java.lang.String Substring that needs to be searched
Return Details
Type int Description index of subbstring. If not found -1.

Free Marker Method - intToStr

Converts specified int value to string using specified radix.

Parameters
Name Type Description
value int Int value to be converted
radix int Radix to be used for conversion
Return Details
Type java.lang.String Description Result substring.

Free Marker Method - intersectionCount

Evaluates the intersection size of specified collections.

Parameters
Name Type Description
collection1 java.util.Collection Collection one to be checked
collection2 java.util.Collection Collection two to be checked
Return Details
Type int Description intersection size of collections

Free Marker Method - isEmpty

Used to check if specified value is empty. For collection, map and string, along with null this will check for empty value.

Parameters
Name Type Description
value java.lang.Object Value to be checked for empty
Return Details
Type boolean Description True if value is empty.

Free Marker Method - isNotEmpty

Used to check if specified value is not empty. For collection, map and string, along with non-null this will check for non-empty value.

Parameters
Name Type Description
value java.lang.Object Value to be checked for empty
Return Details
Type boolean Description True if value is empty.

Free Marker Method - isSubmap

Checks if specified submap is submap of supermap

Parameters
Name Type Description
superMap java.util.Map Super-set map in which submap has to be checked
superMap java.util.Map Sub-set map which needs to be checked
Return Details
Type boolean Description true if comparision is susccessful.

Free Marker Method - lastIndexOf

Finds the last index of specified substring in specified string.

Parameters
Name Type Description
string java.lang.String String in which substring needs to be searched
substr java.lang.String Substring that needs to be searched
Return Details
Type int Description index of subbstring. If not found -1.

Free Marker Method - lower

Converts the specified string to lower case.

Parameters
Name Type Description
string java.lang.String String to be converted
Return Details
Type java.lang.String Description Lower cased substring.

Free Marker Method - lstToSet

Converts specified list into set.

Parameters
Name Type Description
list java.util.List List to be converted
Return Details
Type java.util.Set Description Converted set.

Free Marker Method - mapToString

Converts map of objects into string.

Parameters
Name Type Description
map java.util.Map Prefix to be used at start of coverted string
template java.lang.String Template representing how key and value should be converted into string (the string can have #key and #value which will act as place holders)
prefix java.lang.String Prefix to be used at start of coverted string
delimiter java.lang.String Delimiter to be used between elements.
suffix java.lang.String Suffix to be used at end of string.
emptyString java.lang.String String that will be returned if input map is null or empty.
Return Details
Type java.lang.String Description Converted string
Examples
1 mapToString(map, '#key=#value', '[', ' | ', ']', '')
[a=1 | b=2 | c=3]
2 mapToString(null, '#key=#value', '[', ' | ', ']', '')
<empty>

Free Marker Method - now

Returns the current date object

Return Details
Type java.util.Date Description Current date and time

Free Marker Method - nvl

Used to check if specified value is null and return approp value when null and when non-null.

Parameters
Name Type Description
value java.lang.Object Value to be checked for empty
nullValue java.lang.Object Value to be returned when value is null
nonNullValue java.lang.Object Value to be returned when value is non-null
Return Details
Type java.lang.Object Description Specified null-condition-value or non-null-condition-value.

Free Marker Method - parseDate

Parses string to date using specified format.

Parameters
Name Type Description
string java.lang.String String to parse
format java.lang.String Format to be used for parsing
Return Details
Type java.util.Date Description Parsed date object

Free Marker Method - random

Generates random int.

Return Details
Type int Description Random number

Free Marker Method - randomAlpha

Generates random alpha string with specified prefix.

Parameters
Name Type Description
prefix java.lang.String Prefix that will added to generated random string
length int Expected length of resulting random string
Return Details
Type java.lang.String Description Random string

Free Marker Method - randomAlphaNumeric

Generates random alpha-numeric string with specified prefix.

Parameters
Name Type Description
prefix java.lang.String Prefix that will added to generated random string
length int Expected length of resulting random string
Return Details
Type java.lang.String Description Random string

Free Marker Method - randomDouble

Generates random double in given range.

Parameters
Name Type Description
min double Min value of the expected range
max double Max value of the expected range
Return Details
Type double Description Random number

Free Marker Method - randomFloat

Generates random float in given range.

Parameters
Name Type Description
min float Min value of the expected range
max float Max value of the expected range
Return Details
Type float Description Random number

Free Marker Method - randomInt

Generates random int in given range.

Parameters
Name Type Description
min int Min value of the expected range
max int Max value of the expected range
Return Details
Type int Description Random number

Free Marker Method - randomString

Generates random string with specified prefix (based on timestamp).

Parameters
Name Type Description
prefix java.lang.String Prefix that will added to generated random string
Return Details
Type java.lang.String Description Random string

Free Marker Method - regexMatches

Checks wether specified content is matching with specified regex.

Parameters
Name Type Description
content java.lang.String String which needs to be evaluated aganist regex
regex java.lang.String Regex to be used
Return Details
Type boolean Description True if specified content is matching with specified regex

Free Marker Method - regexParse

Using specified regex tries to find fist match in given content, from that extracts the groups in specified regex.

Parameters
Name Type Description
content java.lang.String String in which specified regex match needs to be found
regex java.lang.String Regex with group names to be extracted from match
Return Details
Type java.util.Map Description From the first match map using group name in regex as key and group value from the match as value

Free Marker Method - regexParseAll

Using specified regex finds all matches for given content, from that extracts the groups in specified regex.

Parameters
Name Type Description
content java.lang.String String in which specified regex match needs to be found
regex java.lang.String Regex with group names to be extracted from match
Return Details
Type java.util.List Description From all matches list of maps are returned. Map uses group name in regex as key and group value from the match as value

Free Marker Method - regexParseMatch

Using specified regex tries to check if content is matched, from that extracts the groups in specified regex.

Parameters
Name Type Description
content java.lang.String String in which specified regex match needs to be found
regex java.lang.String Regex with group names to be extracted from match
Return Details
Type java.util.Map Description From the match map using group name in regex as key and group value from the match as value

Free Marker Method - resBlob

Used to load specified resource as blob object.

Parameters
Name Type Description
res java.lang.String Resource that needs to be converted to blob
Return Details
Type java.sql.Blob Description Loaded blob object.

Free Marker Method - resClob

Used to load specified resource as clob object.

Parameters
Name Type Description
res java.lang.String Resource to be converted into clob
Return Details
Type java.sql.Clob Description Loaded blob object.

Free Marker Method - setAttr

Used to set value as content attribute. This function will always return empty string.

Parameters
Name Type Description
arg0 java.lang.String
arg1 java.lang.Object
Return Details
Type java.lang.String Description Always empty string.

Free Marker Method - sizeOf

Used to fetch size of specified value. If string length of string is returned, if collection size of collection is returned, if null zero will be returned. Otherwise 1 will be returned.

Parameters
Name Type Description
value java.lang.Object Value whose size to be determined
Return Details
Type int Description Size of specified object.

Free Marker Method - split

Splits the given string into list of strings using specified delimiter.

Parameters
Name Type Description
string java.lang.String String to parse
delimiter java.lang.String Delimiter to be used for spliting
Return Details
Type java.util.List Description List of string resulted from spliting.

Free Marker Method - storeValue

Fetches the value of specified key from the store.

Parameters
Name Type Description
key java.lang.String Key of value to be fetched
Return Details
Type java.lang.Object Description Matched value

Free Marker Method - strToInt

Converts specified string to int using specified radix.

Parameters
Name Type Description
value java.lang.String String value to be converted
radix int Radix to be used for conversion
Return Details
Type int Description Result int value.

Free Marker Method - strToList

Converts specified string into list by splitting it using specified delimiter.

Parameters
Name Type Description
str java.lang.String String to be converted
delim java.lang.String Delimiter to be used
Return Details
Type java.util.List Description Converted list.

Free Marker Method - substr

Substring of speicifed string with specified range.

Parameters
Name Type Description
string java.lang.String String from which substring needs to be extracted
start int Start from which substring
string int End index of substring. If negative value is specified, this will be not be used.
Return Details
Type java.lang.String Description Result substring.

Free Marker Method - toBlob

Used to convert specified data into a blob object. Supported parameter types - CharSequence, byte[], Serializable, InputStream.

Parameters
Name Type Description
input java.lang.Object Input that needs to be converted to blob
Return Details
Type java.sql.Blob Description Converted blob object.

Free Marker Method - toClob

Used to convert specified data into a clob. Supported parameter types - CharSequence, byte[], InputStream, Reader.

Parameters
Name Type Description
input java.lang.Object Input that needs to be converted to clob
Return Details
Type java.sql.Clob Description Converted input stream.

Free Marker Method - toJson

Used to convert specified object into json string.

Parameters
Name Type Description
value java.lang.Object Value to be converted into json string.
Return Details
Type java.lang.String Description Converted json string.

Free Marker Method - toReader

Used to convert specified data into a reader. Supported parameter types - CharSequence, byte[].

Parameters
Name Type Description
input java.lang.Object Input that needs to be converted to reader
Return Details
Type java.io.Reader Description Converted input stream.

Free Marker Method - toStream

Used to convert specified data into a input stream. Supported parameter types - CharSequence, byte[].

Parameters
Name Type Description
input java.lang.Object Input that needs to be converted to input stream
Return Details
Type java.io.InputStream Description Converted input stream.

Free Marker Method - toText

Used to convert specified object into string. toString() will be invoked on input object to convert

Parameters
Name Type Description
value java.lang.Object Value to be converted into string.
Return Details
Type java.lang.String Description Converted string. If null, 'null' will be returned.

Free Marker Method - today

Returns the current date object

Return Details
Type java.util.Date Description Current date

Free Marker Method - uiDisplayValue

Fetches display value of specified locator. For select, option label will be fetched. If element is not Select, its ui value will be fetched.

Parameters
Name Type Description
locator java.lang.Object Locator of the ui element whose display value needs to be fetched.
parent java.lang.String Optional. Context attribute name which should hold parent web element.
Return Details
Type java.lang.String Description Value of the ui element

Free Marker Method - uiElemAttr

Fetches attribute value of specified locator.

Parameters
Name Type Description
attrName java.lang.String Name of the attribute whose value to be fetched.
locator java.lang.Object Locator of the ui element whose attribute value needs to be fetched.
parent java.lang.String Optional. Context attribute name which should hold parent web element.
Return Details
Type java.lang.String Description Value of the ui element attribute

Free Marker Method - uiIsPresent

Checks if specified element is present or not (need not be visible).

Parameters
Name Type Description
locator java.lang.String Locator of the ui element whose attribute value needs to be fetched.
parent java.lang.String Optional. Context attribute name which should hold parent web element.
Return Details
Type boolean Description True if element is available (need not be visible)

Free Marker Method - uiIsVisible

Checks if specified element is visible or not.

Parameters
Name Type Description
locator java.lang.Object Locator of the ui element whose attribute value needs to be fetched.
parent java.lang.String Optional. Context attribute name which should hold parent web element.
Return Details
Type boolean Description True if element is visible

Free Marker Method - uiValue

Fetches value of specified locator. If element is text/textarea, its ui value will be fetched.

Parameters
Name Type Description
locator java.lang.Object Locator of the ui element whose element needs to be fetched.
parent java.lang.String Optional. Context attribute name which should hold parent web element.
Return Details
Type java.lang.String Description Value of the ui element

Free Marker Method - upper

Converts the specified string to upper case.

Parameters
Name Type Description
string java.lang.String String to be converted
Return Details
Type java.lang.String Description Lower cased substring.

Expression Types

Defines the steps of autox for all functionalities

Expression Type - attr

Parses specified expression as context attribute.

Examples
1 Default
attr: attrName
2 Using attr with type while setting attribute value. Below example sets value 10 (integer) on context with name intAttr1
<ccg:set expression="attr(int): intAttr1" value="10"/>
3 Using attr to access context attribute value
<ccg:assert-not-null value="attr: intAttr" />

Expression Type - bfile

Parses specified expression as file path and loads it as binary data (byte array).

Examples
1 Default
bfile: /tmp/data

Expression Type - boolean

Parses specified expression into boolean. If expression value is true (case insensitive), then result will be true. In case of '$', current value's string value will be parsed.

Examples
1 Default
boolean: True
2 Using to convert string into boolean and set Boolean object on context
<ccg:set expression="booleanAttr" value="boolean: true"/>
3 Using to convert string into boolean and set Boolean object on context
<ccg:set expression="booleanAttr" value="boolean: true"/>

Expression Type - bres

Parses specified expression as resource path and loads it as binary data (byte array).

Examples
1 Default
res: /tmp/data.json

Expression Type - condition

Evaluates specified expression as condition and resultant boolean value will be returned

Examples
1 Default
condition: (attr.flag == true)
2 Using condition in assertion to check simple conditions
<ccg:assert-true value="condition: attr.intAttr1 gt 5" />
3 Using condition in assertion to check simple conditions
<ccg:assert-true value="condition: attr.intAttr1 gt 5" />

Expression Type - date

Parses specified expression into date. In case of '$', current value's string value will be parsed.

Examples
1 Default
date: 21/3/2018, date(format=MM/dd/yyy): 3/21/2018

Expression Type - double

Parses specified expression into double. In case of '$', current value's string value will be parsed.

Examples
1 Default
double: 10.2

Expression Type - expr

Evaluates specified expression as freemarker expression and resultant value will be returned

Examples
1 Default
expr: today()

Expression Type - file

Parses specified expression as file path and loads it as object. Supported file types: xml, json, properties

Examples
1 Default
file: /tmp/data.json
2 Using file to load file as object and extracting xpath value out of it
<ccg:set expression="xpathAttr1" value="file:./src/test/resources/data/data1.json | xpath: //bean1/prop1"/>
3 Loading file as simple text (instead of loading as object)
<ccg:set expression="outputContent" value="file(text=true): ${attr.response}"/>
4 Using file to load file as object and extracting xpath value out of it
<ccg:set expression="xpathAttr1" value="file:./src/test/resources/data/data1.json | xpath: //bean1/prop1"/>
5 Loading file as simple text (instead of loading as object)
<ccg:set expression="outputContent" value="file(text=true): ${attr.response}"/>

Expression Type - float

Parses specified expression into float. In case of '$', current value's string value will be parsed.

Examples
1 Default
float: 10.2

Expression Type - int

Parses specified expression into int. In case of '$', current value's string value will be parsed.

Examples
1 Default
int: 10

Expression Type - json

Parses specified expression as json string and loads it as object. In case of '$', current value's string value will be parsed.

Examples
1 Default
json: {"a": 2, "b": 3}
2 Converting json into object
<ccg:set expression="beanForTest">
    <value>json:
        {
            "key1" : "value1",
            "key2" : "value2"
        }
    </value>
</ccg:set>
3 Converting json into object and setting it on context
<ccg:set expression="beanForTest">
    <value>json:
        {
            "key1" : "value1",
            "key2" : "value2"
        }
    </value>
</ccg:set>

Expression Type - jsonWithType

Parses specified expression as json (with types) string and loads it as object. In case of '$', current value's string value will be parsed.

Examples
1 Default
jsonWithType: {"a": 2, "b": 3}
2 Converting json with type definitions into object (of specified type)
<s:set expression="attrJson">
    <value>[
        "java.util.HashSet",
        [
            "value1",
            "value2"
        ]
    ]</value>
</s:set>
    
<s:assert-equals expected="jsonWithType: ${attr.attrJson}" actual="set: value1, value2">
</s:assert-equals>
    
<s:assert-equals expected="attr: attrJson | jsonWithType: $" actual="set: value1, value2">
</s:assert-equals>

Expression Type - list

Parses specified expression into list of strings (using comma as delimiter). If type specified, strings will be converted to specified type. In case of '$', current value's string value will be parsed. If current value is collection, it will converted to list directly.

Examples
1 Default
list: val1, val2, val3
2 Converting delimited string of values into list and asserting them
<ccg:assert-equals actual="attr: empNames" expected="list: employee1, employee2"/>
3 Converting delimited string of values into list and asserting them
<ccg:assert-equals actual="attr: empNames" expected="list: employee1, employee2"/>

Expression Type - long

Parses specified expression into long. In case of '$', current value's string value will be parsed.

Examples
1 Default
long: 10

Expression Type - map

Parses specified expression into map of strings (using comma as delimiter and = as delimiter for key and value). If types specified, strings will be converted to specified type. In case of '$', current value's string value will be parsed.

Examples
1 Default
map: key1 = val1, key2=val2, key3=val3

Expression Type - param

Parses specified expression as parameter.

Examples
1 Default
param: paramName

Expression Type - prop

Parses specified expression as bean property on effective-context (context or current object in case of piping).

Examples
1 Default
prop: attr.bean.value1
2 Using prop to access nested properties
<ccg:set expression="propAttr1" value="file:./src/test/resources/data/data1.json | prop: bean1.prop1"/>
3 Using prop to access nested properties
<ccg:set expression="propAttr1" value="file:./src/test/resources/data/data1.json | prop: bean1.prop1"/>

Expression Type - res

Parses specified expression as resource path and loads it as object. Supported file types: xml, json, properties

Examples
1 Default
res: /tmp/data.json
2 Using res to load resource as object and extracting xpath value out of it
<ccg:set expression="xpathAttr2" value="res:/data/data1.json | xpath: //bean1/subbean1/sprop1"/>
3 Parsing resource as template file and then converting result into object
<ccg:set expression="jsonObj" value="res(template=true):/data/data.json"/>
4 Using res to load resource as object and extracting xpath value out of it
<ccg:set expression="xpathAttr2" value="res:/data/data1.json | xpath: //bean1/subbean1/sprop1"/>
5 Parsing resource as template file and then converting result into object
<ccg:set expression="jsonObj" value="res(template=true):/data/data.json"/>

Expression Type - set

Parses specified expression into set of strings (using comma as delimiter). If type specified, strings will be converted to specified type. In case of '$', current value's string value will be parsed. If current value is collection, it will converted to set directly.

Examples
1 Default
set: val1, val2, val3

Expression Type - store

Parses specified expression as value on/from store.

Examples
1 Default
store: key1
2 Using store to set the value into the store
<ccg:set expression="store: testStoreKey" value="value1"/>
3 Using store to fetch the value of the specified key from store
<ccg:set expression="ctxAttrKey" value="store: testStoreKey"/>
4 Using store to set the value into the store
<ccg:set expression="store: testStoreKey" value="value1"/>
5 Using store to fetch the value of the specified key from store
<ccg:set expression="ctxAttrKey" value="store: testStoreKey"/>

Expression Type - string

Returns specified expression as stirng value after triming. In case of '$', current value will be converted to string. In case input object Blob/Clob, string value will be extracted from it.

Examples
1 Default
string: str
2 Using string to escape expression formats
<ccg:assert-equals actual="attr: returnValue" expected="string: beanFromApp:someName"/>
3 Using string to escape expression formats
<ccg:assert-equals actual="attr: returnValue" expected="string: beanFromApp:someName"/>

Expression Type - uival

Parses provided exprssion as ui locator and fetches/sets its value.

Examples
1 Default
uival: id:name

Expression Type - xpath

Parses specified expression as xpath on effective-context (context or current object in case of piping).

Examples
1 Default
xpath: /attr/bean/value1
2 Using xpath to access single property value
<ccg:set expression="xpathAttr1" value="file:./src/test/resources/data/data1.json | xpath: //bean1/prop1"/>
3 Using xpath to access multiple values matching specified path
<ccg:set expression="xpathAttr1" value="xpath(multi=true): /attr/bean1//prop1"/>
4 Using xpath to access properties using xpath
<ccg:set expression="xpathAttr1" value="file:./src/test/resources/data/data1.json | xpath: //bean1/prop1"/>

UI Locators

Defines the steps of autox for all functionalities

Expression Type - class

Used to find ui elements using css class

Expression Type - css

Used to find ui elements using css locator.

Expression Type - id

Used to find ui elements using id.

Examples
1 Accessing ui element with id locator
<ccg:ui-click locator="id: button"/>

Expression Type - js

Used to find ui elements using js expression.

Expression Type - name

Used to find ui elements using name of the element

Expression Type - tag

Used to find ui elements using tag name

Expression Type - xpath

Used to find ui elements using xpath.

Examples
1 Accessing ui element with xpath locator
<ccg:ui-get-value locator="xpath: //input[@name='statusFld']" name="fldValue"/>