Add Control->EVAL to test
EVAL argument is a PHP 5 expression. See https://php-legacy-docs.zend.com/manual/php5/en/index on how to write php
The result of the expression is returned to the CLIPBOARD
Working with Data
Data from Data Tab in Editor can be read from the test to the clipboard.
E.g. setting
FirstName: Barbara
LastName: Mustermann
Age: 26
Read Data
EVAL $FirstName
Reads the value of the FirstName (“Barbara”) into the CLIPBOARD. Note that there is a “$” in front of the variable name using the EVAL command.
Manipulate Data
EVAL $FirstName." ".$LastName
Concatenates $FirstName, ” “, $LastName using the “.” as usual in PHP and returns the result to the CLIPBOARD.
Compute with Data
EVAL $Age + 10
Adds 10 to the variable Age. In the example with Age = 26, this command returns 36 to the CLIPBOARD.
PHP Examples
Measure time between steps
EVAL microtime(true)
:
EVAL microtime(true) - $CLIPBOARD
Returns the time passes in seconds to CLIPBOARD.
Call PHP for TimeStamp
EVAL date_format(new DateTime(), "d.m.Y H:i:s");
Returns a timestamp to CLIPBOARD
Call Java for TimeStamp
EVAL new Java("java.util.Date")->toString();
Returns a timestamp to CLIPBOARD
Manipulate strings
EVAL substr($CLIPBOARD, 0,strlen($CLIPBOARD)-5)
Removes the last 4 characters from CLIPBOARD
Set and Get values from data store
EVAL get("result")."\r\n".$CLIPBOARD)
Concatenates via “.” the string in the data store”result” with a newline (“\r\n”) and CLIPBOARD contents.
EVAL set("result")
Sets the value of the data store “result” to the value of the CLIPBOARD.
EVAL set("result", get("result") ."\r\n". $CLIPBOARD)
Performs the concatenation of the setting of the data store with a single line of code.