Echo ,Store command and storeVars
Store command
Helps in declaring and assigning a value to variable
Ex:
Command : store
Target :1000
Value : a
This will create a
variable ‘a’ and assign 1000 as its
value
Echo command
Helps in printing a value to the log. It can be character,
string, number or value of variable.
To print value of variable,
Command: echo;
Target: ${Variable Name}
Ex:
Command: echo
Target: $(a)
This will print value of variable ‘a’ that is 1000 to the
blog
Note:
If you simple give ‘a’ in the target instead of ‘${a}’ then
this is treated as a string/Character and ‘a’
is printed to log but not its value.
All the variables declared in a test are stored into an
array called ‘storedVars’ .In order to refer value of variable inside
storedVars array, you can call Target: JavaScript {storedVars [‘a’]}
Command: echo
Target: JavaScript{storedVars[a]}
Command: echo
Target : storedVars[‘a’] to the log but not value of ‘a’
Assigning value of
variable to another variable:
Command : store
Target :${a}
Value : b
Or
Command : store
Target: JavaScript{storedVars[a]}
Value: b
In both examples mentioned above , value of ‘a’ assigned to
variable ‘b’
storeEval Command:
Using storeEVal Command
you can directly assign or print
value of a variables without help of
‘Javascript{}’ in the target
Ex:
Command : storeEVal
Target : storedVars{a}
Value : c
Observe that in the
above example we are directly calling storedVars[‘a’] to assign value to
variable ‘a’ to ‘c’
No comments:
Post a Comment