Commands
abs
returns java.lang.Math.abs(arg)
The return type of an operation is determined by the following rules:
string
arg is converted to long
boolean
arg is converted to long
(1 for true
and 0 for false
)
double
, float
, long
args retain its original type
- Otherwise (in case of
byte
, char
, or short
) the returned value has type int
-
Input:
-
arg
optional Object
-
Example:
-
emit "-10.6" | int | abs | str | log (writes 10 to log)
activate-cell-edit
Activates cell editing.
-
Input:
-
control
ControlHandler: Item of table, list or tree.
-
Parameters:
-
column
Integer
-
Output:
-
value of
control
parameter
-
Example:
-
get-editor Test | get-section Preferences | get-tree | select "EXECUTION_TIMEOUT" | activate-cell-edit -column 1
activate-direct-edit
Activates direct editing.
-
Input:
-
control
ControlHandler: Edit part or figure.
-
Output:
-
value of
control
parameter
-
Example:
-
get-editor SO | get-diagram | get-edit-part -className ProcessEditPart | get-edit-part -name Invoke
| activate-direct-edit
add-repository
Adds p2 repository.
-
Parameters:
-
uri
optional String = ""
-
name
optional String = ""
-
Output:
-
nothing
and
Computes the result of logical And operation for passed arguments.
-
Parameters:
-
args
(2, ∞) Object: Arguments to compute on.
-
Output:
-
true
or false
.
-
Example:
-
with [get-view "Q7 Explorer" | get-tree] {
if [and[get-item Project | get-property caption -raw | eq Project][get-property itemCount -raw | eq 1]] {
log -message "Both verifications passed"
}
}
apply-cell-edit
Applies cell editing.
-
Input:
-
control
ControlHandler: Item of table, list or tree.
-
Parameters:
-
deactivate
optional Boolean = false
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-editor context | get-section Parameters | get-table] {
select parameter1 | activate-cell-edit -column 1
get-editbox | set-text value
apply-cell-edit -deactivate
}
as-table-data
Converts its input to table data format, exactly the same as get-table-data
returns.
-
Input:
-
input
(0, ∞) Object: Object(s) to convert from.
-
Output:
-
Table data.
-
Example:
-
get-log -levels error | as-table-data | write-csv-file "workspace:/Project/file2.csv"
assert-empty
Asserts that input pipe doesn't contain anything
-
Parameters:
-
message
optional String = "": Message to fail with when input is not empty
-
Output:
-
Nothing
-
Example:
-
find-in-workspace -path "Project/nonexisting.file" | assert-empty
assert-non-empty
Asserts that input pipe contain something
-
Parameters:
-
message
optional String = "": Message to fail with when input is empty
-
Output:
-
Nothing
-
Example:
-
find-in-workspace -path "Project/.*" | assert-non-empty
assert-tables-match
Compares contents of two tables. If contents are not the same, fails with a descriptive message
-
Parameters:
-
left
optional Table
-
right
optional Table
-
ignoreColumnOrder
optional Boolean = false: When true, column order is not taken into account
-
ignoreMissingColumns
optional IgnoreColumnsMode = NONE: Describes the comparison behaviour in case when one of tables contains a column which is not present in other table:
- NONE – all columns must be present in both tables
- LEFT – columns from right table which are not present in left, are ignored
- RIGHT – columns from left table which are not present in right, are ignored
- BOTH – comparison performed only on columns present in both tables
Another way to interpret this argument is that it is an answer on question "Which column can have less columns?"
The primary reasoning for this argument is to provide smooth migration when presentation is changed – consider this scenario: we have a CSV file with table data, and we have UI table. If we add or remove extra columns in the UI, we can keep existing sample data file and just correct the ignoreMissingColumns
argument
-
Example:
-
assert-tables-match [get-editor "context" | get-section Parameters | get-table | get-table-data ]
[get-editor "context2" | get-section Parameters | get-table | get-table-data]
assert-true
If input is not true, fails
-
Input:
-
input
optional Boolean: Input value. Must be true.
-
Parameters:
-
message
optional String = "": Message to fail with when input is not true
-
Output:
-
Nothing
-
Example:
-
...get-tree | get-item Project | get-property childCount -raw | gt 3 | assert-true -message "Child count is not greater then 3!"
aut-reconnect
aut-reconnect
-
Parameters:
-
q7EclPort
optional Integer
-
id
optional String = ""
aut-send-event
aut-send-event
-
Parameters:
-
id
optional String = ""
-
event
optional AutEvent
between
returns true
if input
is greater than or equal to left
and less than or equal to right
Before performing an operation, arguments are converted according to the following rules:
string
arguments converted to long
boolean
arguments converted to long
(1 for true
and 0 for false
)
- If one of arguments is
double
, converts the other one to double
- If one of arguments is
float
, converts the other one to float
- If one of arguments is
long
, converts the other one to long
- Otherwise (in case of
byte
, char
, or short
) converts both arguments to int
-
Input:
-
input
optional Object
-
Parameters:
-
left
optional Object
-
right
optional Object
-
Example:
-
int 10 | between 7 12 | verify-true
bool
Converts its argument to boolean.
-
Input:
-
input
optional Object: Argument to be converted.
-
Output:
-
Returns boolean value or fails if value cannot be converted.
-
Example:
-
bool true | assert-true
bool 1 | assert-true
cancel-cell-edit
Cancels cell editing.
-
Input:
-
control
ControlHandler: Item of table, list or tree.
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-editor context | get-section Parameters | get-table] {
select "Add new parameter" | activate-cell-edit
get-editbox | set-text "this text won't be applied"
cancel-cell-edit
}
cancel-direct-edit
Cancels direct editing.
-
Input:
-
control
ControlHandler: Edit part or figure.
-
Output:
-
value of
control
parameter
-
Example:
-
get-editor SO | get-diagram | get-edit-part -className ProcessEditPart | get-edit-part -name Invoke {
  activate-direct-edit
  cancel-direct-edit
}
case
Corresponds command from then
branch if an object from the input
matches the condition
object.
-
Parameters:
-
condition
Object: Object used to match to the
input
. Accepted values are boolean, string (true
when case-insensitive equals to true
, false
otherwise) and number (0
for false
, true
otherwise).
-
then
optional Command: Branch being executed when
input
matches the object specified in condition
-
Output:
-
An internal object describing the case.
-
Example:
-
list 1 2 3 | get 0 | switch [case 1 {
log -message "First item is 1"
}] [case 2 {
log -message "First item is 2"
}]
check
Checks the control.
-
Input:
-
control
ControlHandler: Item of table, list or tree.
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-editor Wb | get-section Workbench] {
get-button "Clear clipboard" | check
}
clear-log
Removes log file. Note that if log view is open, it may enter into inconsistent state. If it is important, use clear-log-view
instead
-
Output:
-
Nothing
clear-log-view
Clears error log. If Error log is open, then it is closed before log clearing and then open again.
-
Output:
-
Nothing
click
Clicks on a control.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
nowait
optional Boolean
-
default
optional Boolean: Specifies if clicking causes default selection.
-
arrow
optional Boolean: Specifies arrow button behavior.
-
Output:
-
value of
control
parameter
-
Example:
-
get-editor TestSuite | get-section "Test Cases" | get-button "Add Test Case" | click
click-column
Clicks on a header of table or tree column. The column is identified by name
and index
. If name is empty, then column is identified by zero-based index. If there is more than one column with a given name, then index
can be used. In this case index
is used to identify the column within all other columns with the same name. If there are no columns with given name, then command tries to interpret name
as Java regular expression pattern and search for a column.
-
Input:
-
control
optional ControlHandler
-
Parameters:
-
name
optional String = ""
-
index
optional Integer
-
Output:
-
Table
object or Tree
control
-
Example:
-
get-table | click-column Description //clicks on a header of column Description
get-table | click-column -index 5 //clicks on 6th column header (since index is 0-based)
get-table | click-column -name "D.*" -index 1 //clicks on a second column starting with "D"
click-link
Clicks on a link.
-
Input:
-
control
optional ControlHandler
-
Parameters:
-
ref
optional String = ""
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-window Preferences] {
get-tree | select "Ant/Editor"
get-link "See \'Text Editors\' for general text editor preferences and \'Colors and Fonts\' to configure the font."
| click-link "org.eclipse.ui.preferencePages.GeneralTextEditor"
get-button OK | click
}
click-ruler
Clicks a ruler at given position with specified button and modifiers
-
Input:
-
control
ControlHandler: Editor ruler
-
Parameters:
-
line
optional Integer
-
button
optional String = "Left"
-
with
optional String = ""
-
Output:
-
value of control parameter
-
Example:
-
with [get-left-ruler | get-ruler-column AnnotationColumn] {
click-ruler -line 2
}
click-text
Clicks on editbox to set cursor position (when only start
argument specified) or text selection (when both start
and end
are set). When no arguments given, sets cursor in the beginning of an editbox. More verbosely, it does the following:
- Sets focus to editbox if not yet focused
- Sends mouse down and up events
- Sets caret position or text selection based on arguments
start
and end
arguments have different forms depending on editbox kind:
- For single line editboxes – 1-based indices in text (e.g.
1
, 5
)
- For multi line editboxes – 1-based line and colum indices separated by colon (e.g
1:32
, 30:1
).
-
Input:
-
control
optional ControlHandler
-
Parameters:
-
start
optional String = "": Cursor location when
end
is not set or selection start otherwise
-
end
optional String = "": Selection end
-
button
optional String = "left": Mouse button: left, right or middle.
-
Output:
-
input item
-
Example:
-
with [get-editbox -after [get-label "Location:"]] {
click-text 3
}
close
Closes the control.
-
Input:
-
control
ControlHandler: Window, view or editor.
-
Output:
-
value of
control
parameter
-
Example:
-
get-window "Q7 Control Panel - Test" | close
collapse
Collapses a tree item. Item must be acquired by using get-item
command.
-
Input:
-
control
optional ControlHandler
-
Output:
-
value of
control
parameter
-
Example:
-
get-view "Q7 Explorer" | get-tree | get-item "Project/folder" | collapse
collapse-all
Collapses a tree item and all its children, or a whole tree.
-
Input:
-
control
optional ControlHandler
-
Output:
-
value of
control
parameter
-
Example:
-
get-view "Q7 Explorer" | get-tree | collapse-all
commit-direct-edit
Commits direct editing.
-
Input:
-
control
ControlHandler: Edit part or figure.
-
Output:
-
value of
control
parameter
concat
Concatenates strings passed as arguments
-
Parameters:
-
strs
(0, ∞) String = ""
-
Output:
-
Concatenated string value
-
Example:
-
concat "Mess" "age" | equals "Message" | assert-true
constrain-max
Takes a property name and a number. Reads from the input stream object, takes his property and compares with a defined value.
-
Input:
-
counter
optional Object
-
Parameters:
-
property
optional String = ""
-
value
optional Integer
-
Output:
-
True if received number is less or equal to defined value. False if number is greater than defined value.
-
Example:
-
measure-time "MyCounterName" {
// some ECL script
} | constrain-max duration 2000
// fail if the operation was more than 2 seconds with a message
//Max constraint violation: 'MyCounterName' duration is 100500 which is greater than 2000.
contains
Checks if input
has value
within
-
Input:
-
input
Object: Property value extracted with
get-property
-
Parameters:
-
value
String: Value, which is expected to be included
-
Output:
-
true if the content of control contains the specified value or false otherwise
-
Example:
-
get-editor TestCase1 | get-editbox | get-property value | contains a22 | verify-true
copy-file
Copies source
file or directory into destination
directory, optionally giving it a new name
.
-
Parameters:
-
source
String: Source file or directory.
-
destination
String: Destination directory under which the
source
file or directory will be stored.
-
name
optional String = "": New name for the
source
file or directory.
-
Output:
-
Nothing.
-
Example:
-
copy-file -source "/Users/Ulik_MacAir/aut-Q7-1.3.12-B2/Project/t.test"
-destination "/Users/Ulik_MacAir/aut-Q7-1.3.12-B2/Project/Folder" -name "Clone.test"
create-working-set
Creates working set with a given name.
-
Input:
-
name
optional String = "": Working set name
-
Parameters:
-
type
optional String = "org.eclipse.ui.resourceWorkingSetPage": Working set type id. Default value is
org.eclipse.ui.resourceWorkingSetPage
, which corresponds to Resource Working Set. The short name java
can be used to identify type org.eclipse.jdt.ui.JavaWorkingSetPage
-
Output:
-
Nothing
-
Example:
-
create-working-set "MyWorkingSet"
deactivate-cell-edit
Applies cell editing.
-
Input:
-
control
ControlHandler: Item of table, list or tree.
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-editor context2 | get-section Parameters | get-table] {
select parameter | activate-cell-edit -column 1
get-editbox | set-text "value"
cancel-cell-edit
deactivate-cell-edit
}
decrypt
Decrypts an encrypted string
-
Parameters:
-
value
String
-
Output:
-
Decrypted string
delete-file
Deletes file or folder identified by URI.
Currently supported schemes are workspace:/ for files in workspace and file:/ for files on local file system.
-
Input:
-
uri
String: URI of a file or directory. Can be created manually, or with uri-from-path.
-
Output:
-
Nothing
-
Example:
-
delete-file "file:/C:/temp/1.txt"
delete-file [uri-from-path "C:/temp/2.txt"]
uri-from-path "C:/temp/3.txt" | delete-file
get-file "file:/C:/temp/4.txt" | delete-file
str "workspace:/MyProject/text.txt" | delete-file
delete-working-set
Deletes working set
-
Input:
-
input
optional WorkingSet: Working set object
-
Output:
-
Nothing
-
Example:
-
list-working-sets | foreach {delete-working-set}
div
returns left / right
Before performing an operation, arguments are converted to the widest type according to the following rules:
string
arguments converted to long
boolean
arguments converted to long
(1 for true
and 0 for false
)
- If one of arguments is
double
, converts the other one to double
- If one of arguments is
float
, converts the other one to float
- If one of arguments is
long
, converts the other one to long
- Otherwise (in case of
byte
, char
, or short
) converts both arguments to int
-
Input:
-
left
optional Object: Left argument
-
Parameters:
-
right
optional Object: Right argument
-
Example:
-
div 10 5 | equals 2 | assert-true -message "10/5 not equals 2!"
double-click
Double clicks on a control.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
nowait
optional Boolean
-
default
optional Boolean: Specifies if clicking causes default selection.
-
arrow
optional Boolean: Specifies arrow button behavior.
-
Output:
-
value of
control
parameter
-
Example:
-
get-view "Q7 Explorer" | get-tree | select "TestProject/Test" | double-click
double-click-ruler
Double clicks ruler on given line with specified modifiers and mouse button
-
Input:
-
control
ControlHandler: Editor ruler
-
Parameters:
-
line
optional Integer
-
button
optional String = "Left"
-
with
optional String = ""
-
Output:
-
value of control parameter
-
Example:
-
with [get-editor t | get-section Script | get-left-ruler | get-ruler-column AnnotationColumn] {
double-click-ruler 1
}
double-click-text
Double-clicks on editbox to set cursor position and/or selection. More verbosely, it does the following:
- Sets focus to editbox if not yet focused
- Sends double-click event
position
argument have different form depending on editbox kind:
- For single line editboxes – 1-based indices in text (e.g.
1
, 5
)
- For multi line editboxes – 1-based line and colum indices separated by colon (e.g
1:32
, 30:1
).
-
Input:
-
control
optional ControlHandler
-
Parameters:
-
position
String: Cursor location where the double-click will occur.
-
button
optional String = "left": Mouse button: left, right or middle.
-
Output:
-
input item
-
Example:
-
with [get-editbox -after [get-label "Project name:"]] {
set-text Project1
double-click-text 9 1
}
drag-accept
Emulates drag accept event.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
x
optional Integer: X coordinate relative to left top corner of the control.
-
y
optional Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button = none: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
detail
optional String = "none": Kind of DND operation to perform:
copy
, move
, link
, target-move
(move to non-SWT application) or none
(if not applicable).
-
operation
optional Integer = -1
-
Output:
-
value of
control
parameter
-
Example:
-
get-item "Project/Folder" | drag-accept 18 11 -detail copy
drag-action
Emulates drag action event.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
x
optional Integer: X coordinate relative to left top corner of the control.
-
y
optional Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button = none: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
detail
optional String = "none": Kind of DND operation to perform:
copy
, move
, link
, target-move
(move to non-SWT application) or none
(if not applicable).
-
operation
optional Integer = -1
-
Output:
-
value of
control
parameter
drag-detect
Emulates drag detect event.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
x
optional Integer: X coordinate relative to left top corner of the control.
-
y
optional Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button = none: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
detail
optional String = "none": Kind of DND operation to perform:
copy
, move
, link
, target-move
(move to non-SWT application) or none
(if not applicable).
-
operation
optional Integer = -1
-
Output:
-
value of
control
parameter
drag-end
Emulates drag end event.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
x
optional Integer: X coordinate relative to left top corner of the control.
-
y
optional Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button = none: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
detail
optional String = "none": Kind of DND operation to perform:
copy
, move
, link
, target-move
(move to non-SWT application) or none
(if not applicable).
-
operation
optional Integer = -1
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-view "Project Explorer" | get-tree] {
drag-end -detail copy
select "Project/Folder/t.test" | get-menu Delete | click
}
drag-enter
Emulates drag enter event.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
x
optional Integer: X coordinate relative to left top corner of the control.
-
y
optional Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button = none: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
detail
optional String = "none": Kind of DND operation to perform:
copy
, move
, link
, target-move
(move to non-SWT application) or none
(if not applicable).
-
operation
optional Integer = -1
-
Output:
-
value of
control
parameter
-
Example:
-
get-item "Project/t.test" | drag-enter 23 11 -detail copy
drag-exit
Emulates drag exit event.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
x
optional Integer: X coordinate relative to left top corner of the control.
-
y
optional Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button = none: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
detail
optional String = "none": Kind of DND operation to perform:
copy
, move
, link
, target-move
(move to non-SWT application) or none
(if not applicable).
-
operation
optional Integer = -1
-
Output:
-
value of
control
parameter
-
Example:
-
get-item "Project/t.test" | drag-exit
drag-over
Emulates drag over event.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
x
optional Integer: X coordinate relative to left top corner of the control.
-
y
optional Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button = none: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
detail
optional String = "none": Kind of DND operation to perform:
copy
, move
, link
, target-move
(move to non-SWT application) or none
(if not applicable).
-
operation
optional Integer = -1
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-view "Project Explorer" | get-tree] {
select "Project/t.test"
get-item "Project/t.test" | drag-start 23 5
get-item "Project/t.test" | drag-enter 23 11 -detail copy
get-item "Project/t.test" | drag-over 23 11 -detail copy
get-item "Project/q7.properties" | drag-over 21 2 -detail copy
drag-over 70 84 -detail copy
get-item "Project/file.csv" | drag-over 19 0 -detail copy
get-item "Project/context2.ctx" | drag-over 18 0 -detail copy
drag-over 69 33 -detail copy
get-item "Project/Folder" | drag-over 18 11 -detail copy
get-item "Project/t.test" | drag-exit
get-item "Project/Folder" | drag-accept 18 11 -detail copy
drag-set-data
get-item "Project/Folder" | drop 18 11 -detail copy
}
drag-set-data
Emulates drag set event.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
x
optional Integer: X coordinate relative to left top corner of the control.
-
y
optional Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button = none: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
detail
optional String = "none": Kind of DND operation to perform:
copy
, move
, link
, target-move
(move to non-SWT application) or none
(if not applicable).
-
operation
optional Integer = -1
-
Output:
-
value of
control
parameter
drag-start
Emulates drag start event.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
x
optional Integer: X coordinate relative to left top corner of the control.
-
y
optional Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button = none: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
detail
optional String = "none": Kind of DND operation to perform:
copy
, move
, link
, target-move
(move to non-SWT application) or none
(if not applicable).
-
operation
optional Integer = -1
-
Output:
-
value of
control
parameter
-
Example:
-
get-item "Project/t.test" | drag-start 23 5
drop
Emulates drop event.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
x
optional Integer: X coordinate relative to left top corner of the control.
-
y
optional Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button = none: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
detail
optional String = "none": Kind of DND operation to perform:
copy
, move
, link
, target-move
(move to non-SWT application) or none
(if not applicable).
-
operation
optional Integer = -1
-
Output:
-
value of
control
parameter
-
Example:
-
get-editor t | get-section Contexts | get-table | drop 111 52 -detail move
each
Iterates over list or map. Accepts one or two variable declarations, when only one variable given, it will be hold list elements or map values. A second variable, if provided, used for map keys or list element indices.
-
Input:
-
input
Object: Map or List
-
Parameters:
-
val
Val
-
key
optional Val
-
do
optional Command
-
Example:
-
// Iterate over elements.
list 1 2 3 | each [val element] {
log [format "%d" $element]
}
// Iterate over elements with indices
list 1 2 3 | each [val element] [val index] {
log [format "list[%d] = %d" $index $element]
}
// Iterate over map values
map [entry "one" 1] [entry "two" 2] | each [val value] { log [str $value] }
// Iterate over map values with keys
map [entry "one" 1] [entry "two" 2] | each [val v] [val k] { log [concat $k " = " [str $v]] }
echo
Takes a string argument and writes it into an output pipe.
-
Input:
-
str
optional String = ""
-
Output:
-
value of
str
argument
emit
Writes its arguments into output pipe.
-
Parameters:
-
values
(0, ∞) Object
-
Output:
-
List of arguments
-
Example:
-
emit "hello" "world" | foreach { log }
entry
Creates a new map entry. Can only be used as an argument for map command.
-
Parameters:
-
key
optional Object
-
value
optional Object
eq
Compares arguments on equality
-
Input:
-
left
optional Object: Left argument
-
Parameters:
-
right
optional Object: Right argument
-
Output:
-
true
when args are equal, false
otherwise.
equals
Compares input
with value
-
Input:
-
input
Object: Property value extracted with
get-property
-
Parameters:
-
value
String: Expected property value
-
Output:
-
true if values are equal or false otherwise
-
Example:
-
get-view "Q7 Explorer" | get-tree | get-item Project | get-property childCount | equals 3 | verify-true
exclude-columns
Takes a table from input and returns the same table which has some columns excluded.
-
Input:
-
table
optional Table: Table to exclude columns from
-
Parameters:
-
columns
(0, ∞) String = "": Column names to exclude from table. It is OK to pass column names which are not present in table
-
Output:
-
Copy of input table object without columns with names listed in
columns
-
Example:
-
get-view "Error Log" | get-tree | get-table-data | exclude-columns "Message" "Plug-in" | write-csv-file "workspace:/MyProject/AssertData/table.csv"
exclude-rows
Takes a table from input and returns the table with rows filtered by column and criteria.
-
Input:
-
table
optional Table: Table to take columns from
-
Parameters:
-
column
optional String = "": Column named to filter rows by.
-
value
optional String = "": Pattern to match rows to.
-
match
optional RowMatchMode: Describes the matching behaviour for rows.
- glob – wildcard matching
- exact – value should be equals to pattern
- regext – value must match java regular expression
-
Output:
-
Copy of input table object with filtered rows.
-
Example:
-
exclude-rows -column "columnName" -value "value" -match exact|glob|regex
exec-process
Executes shell command.
-
Input:
-
stdin
optional String = "": String to send to stdin of executed command.
-
Parameters:
-
command
String: Shell command to execute.
-
args
(0, ∞) String = "": Arguments for the command.
-
timeout
optional Integer = 60: Timeout period in seconds. Use zero timeout (
-timeout 0
) for infinite timeout.
-
ignoreExitCode
optional Boolean = false: If set to true, command will not fail with error message if non-zero exit code returned.
-
ignoreStderr
optional Boolean = false: If set to true, command will not fail with error message if stderr is not empty.
-
Output:
-
ExecProcessResult filled with execution results: exit code, captured stdout and stderr.
-
Example:
-
exec-process "\"C:\\Program Files\\Sikuli X\\Sikuli-IDE.exe\"""-r" [substitute-variables "\"${resource_loc:sikuli/MistypeClassName.sikuli}\""]"-s"-ignoreExitCode
expand
Expands a tree item. Item must be acquired by using get-item
command.
-
Input:
-
control
optional ControlHandler
-
Output:
-
value of
control
parameter
-
Example:
-
get-view "Q7 Explorer" | get-tree | get-item Project | expand
expand-all
Expands a tree item and all its children, or a whole tree.
-
Input:
-
control
optional ControlHandler
-
Output:
-
value of
control
parameter
-
Example:
-
get-view "Q7 Explorer" | get-tree | get-item Project | expand-all
find-in-workspace
Perform regex search per segment. Returns list of matched paths.
-
Parameters:
-
path
String
-
all
optional Boolean = false
-
Output:
-
list of matched paths
-
Example:
-
find-in-workspace "project/dir1.*/dir2/file.*.txt"
float
Converts its argument to float.
-
Input:
-
input
optional Object: Argument to be converted.
-
Output:
-
Returns float value or fails if value cannot be converted. true
is converted to 1.0
and false
is converted to 0
. This command uses java.lang.Float.parseFloat
method, but also supports a few additional text values for infinity:
- +inf – returns
Float.POSITIVE_INFINITY
- inf – returns
Float.POSITIVE_INFINITY
- -inf – returns
Float.NEGATIVE_INFINITY
foreach
Reads objects from input pipe and for each object executes a given do
command for each item. An optional variable declaration to hold a current value can be passed, if it is not passed, then current value is sent into an input pipe of a do
command.
-
Input:
-
input
(0, ∞) Object
-
Parameters:
-
item
optional Val
-
do
optional Command
-
Output:
-
An aggregated output of
do
command
-
Example:
-
// Implicit item: sent to an input pipe of inner script
list-launch-configurations | foreach { get name | log }
// Explicit item:
list-launch-configuration | foreach [val item] {
$item | get-name | log
}
Writes a formatted string to output pipe
-
Parameters:
-
format
optional String = "": Format string as in Java's String.format
-
args
(0, ∞) Object: Arguments for format string
-
Output:
-
Formatted string
-
Example:
-
format "string: %s, int: %d" "foo" 5 | log
Reads timestamp value (as a number of milliseconds since January, 1, 1970) from input pipe and formats according to given format string. Format string is the same as used in java.text.SimpleDateFormat
.
-
Parameters:
-
format
optional String = ""
-
Output:
-
String representation of given time
-
Example:
-
get-time | format-time -format "dd.MM.yyyy" | log
// writes current date, month and year into log
get
Depending on input object, either returns a value by key from map, or element by index from list, or member of EMF object by name.
-
Input:
-
input
optional Object: Object to get a value from
-
Parameters:
-
key
optional Object: Depending on an input object either a key in a map, or index in a list, or name of a feature/attribute of EMF object
-
default
optional Object: Value to return if input object does not contain value by requested key
-
Example:
-
//types 1 into log
emit "1" "2" "3" | to-list | get 0 | str | log
//types Febuary into log
map [entry 1 January][entry 2 Febuary] | get 2 | log
Returns the "About" menu.
-
Output:
-
About menu
-
Example:
-
get-about-menu | click
get-window "About Q7" | get-button OK | click
get-banner
get-banner
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
Gets button with defined caption. If this button doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
link to the button
-
Example:
-
get-button Replay | click
get-by-os
Returns value depending on current operating system. This allows to create cross-platform tests in cases when assertion values slightly differ on various operating system – this command can be used as an argument for commands like equals
:
... | get-property "text" | equals [
get-by-os -macosx "Mac value" -win "Windows value" -linux "Linux value"
] | verify-true
When two platforms have the same value, it is convenient to use -default
argument. For example, if some value is the same on Linux and Mac OS X, but differs on Windows, get-by-os
can be used like this:
get-by-os -win "Windows value" -default "Mac OS X and Linux value"
-
Parameters:
-
default
optional String = "": Value to use when no platform-specific argument specified
-
win
optional String = "": Value to use on Windows
-
linux
optional String = "": Value to use on Linux
-
macosx
optional String = "": Value to use on Mac OS X
-
Output:
-
Value of an argument corresponding to current platform, or value of
default
argument.
get-canvas
get-canvas
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Example:
-
with [get-editor CreateQ7Project | get-section Script | get-canvas] {
mouse-press 24 53 button1
mouse-release 24 53 button1 524288
}
get-cell
Gets cell with defined parameter. If this cell doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
row
Integer
-
column
Integer
-
Output:
-
cell
-
Example:
-
get-editor context | get-section Parameters | get-table | get-cell -row 1 -column 1 |
get-property text -raw | str | log
get-checkbox
Gets checkbox with defined parameter. If this checkbox doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
link to the checkbox
-
Example:
-
get-editor Wb | get-section Workbench | get-checkbox -text "Clear clipboard" | check
get-color-selector
get-color-selector
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
get-column-header
Gets column of a table or tree control.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
column
-
Example:
-
get-table | get-column-header Name | click // sorts by Name column
get-combo
Gets combobox with defined parameter. If this combobox doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
link to the combobox
-
Example:
-
get-window "Q7 Control Panel - Test" | get-window "Find/Replace" | get-combo -after [get-label "Replace with:"] | get-property enablement | equals false
get-connection-handle
Gets connection handle on diagram. If the connection handle is not found, the error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
path
String: Indicates the path to the item. This parameter is used by default, so
-path
word is not written at the recording of the test.
-
Output:
-
connection handle
-
Example:
-
get-editor Diagram | get-diagram | get-edit-part -className DiagramEditPart | get-connection-handle 0 | mouse-move 1 6 button1 -height 16 -width 20
get-control
Gets control with defined caption or index. If this control doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
path
String: Indicates the path to the item. This parameter is used by default, so
-path
word is not written at the recording of the test.
-
kind
String
-
Output:
-
link to the control
-
Example:
-
//writes 'Perspective id:' into log
get-editor WorkbanchContext | get-section Workbench | get-control -kind "Label" -index 1 | get-property text -raw| str | log
get-coolbar
get-coolbar
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
get-date-time
Gets pop-up window of calendar. If this pop-up window doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
calendar pop-up window
get-diagram
Gets diagram with specified parameter. If diagram doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
diagram
-
Example:
-
get-editor Network | get-diagram | get-edit-part -name Network | mouse-hover 139 377 -height 609 -width 1034
get-eclipse-window
Gets Eclipse window.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
Eclipse window
-
Example:
-
get-eclipse-window | key-type F8
get-edit-part
Gets EObject part that should be edited
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
path
optional String = "": Path to EObject
-
name
optional String = "": Name of EObject
-
feature
optional String = ""
-
className
optional String = ""
-
text
optional String = ""
-
Output:
-
Part of EObject
-
Example:
-
get-editor Network | get-diagram | get-edit-part -name Network | mouse-hover 139 377 -height 609 -width 1034
get-editbox
Gets editbox with defined parameter. If this editbox doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
link to the editbox
-
Example:
-
get-view "Execution View" | get-editbox -after [get-label "Message:"] | get-property text | equals "" | verify-true
get-editor
Gets editor with defined parameter. If editor doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
editor
-
Example:
-
get-editor EclContext | get-section Script | get-editbox | get-property text | equals "wait 1000" | verify-true
get-empty-area
Gets the Nebula Grid empty area specified by its place.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
top
optional Boolean: Area is located on the top header line. Can be combined with
-left
parameter to get the intersection corner.
-
left
optional Boolean: Area is located on the left header column. Can be combined with
-top
parameter to get the intersection corner.
-
column
optional String = "": Area is located at the bottom of specified column. Must not be combined with
-top
or -left
parameters.
-
Output:
-
grid empty area
-
Example:
-
get-nebula-grid | get-empty-area -top -left
get-nebula-grid | get-empty-area -column "Column Title"
get-nebula-grid | get-item "Item Label" | get-empty-area
get-entry
Gets entry from palette
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
Palette entry
get-expand-bar
get-expand-bar
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
get-expand-item
get-expand-item
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
Gets figure with specified coordinates. If figure doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
path
String: Indicates the path to the item. This parameter is used by default, so
-path
word is not written at the recording of the test.
-
Output:
-
figure
-
Example:
-
get-editor Diagram | get-palette | get-figure "0/3/1/0/0/0/0/1/1/0"
get-file
Creates a file object by its URI.
-
Input:
-
uri
String: URI of a file or directory. Can be created manually, or with uri-from-path.
-
Output:
-
A File object. Properties: uri, name, exists, children.
-
Example:
-
get-file "file:/C:/Windows/System32" | get exists
get-group
Gets group with defined parameter. If this group doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
group
-
Example:
-
get-window Search | get-group "Search in" | get-button Tags | click
get-handle
Gets specified handle of GMF element. If this handle is not found, the error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
handle
-
Example:
-
get-editor Diagram | get-diagram | get-edit-part -className DiagramEditPart | get-handle ResizeHandle | mouse-hover 5 5 -height 7 -width 7
get-hotkey
get-hotkey
-
Parameters:
-
commandId
optional String = ""
get-item
Gets item at the specified path. If this item doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
path
optional String = "": Indicates the path to the item. This parameter is used by default, so
-path
word is not written at the recording of the test.
-
column
optional String = ""
-
Output:
-
item
-
Example:
-
get-view Breakpoints | get-tree | get-item CreateJavaProject | get-property checked | equals false | verify-true
get-item-cell
Gets the Nebula Grid item cell by its column name.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
column
String
-
Output:
-
item cell
-
Example:
-
get-nebula-grid | get-item "Item Label" | get-item-cell -column "Column Title"
get-items
Gets item list of a table, or visible items of a tree, or visible children of a tree item.
-
Input:
-
control
optional ControlHandler
-
Output:
-
List of items.
-
Example:
-
get-view "Q7 Explorer" | get-tree | get-items | foreach {get-property caption -raw | str | log}
get-java-property
Gets the Java system property indicated by the specified key.
-
Parameters:
-
key
String: The name of the system property.
-
default
optional String = "": Default value to use if there is no property with the key.
-
Output:
-
The string value of the system property.
-
Example:
-
get-java-property "java.home" | log
get-label
Gets label with defined text. If this label doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
link to the label
-
Example:
-
get-view "Execution View" | get-label -after [get-label "Runs:"] | get-property caption | equals "3/3" | verify-true
get-left-ruler
Gets the left ruler of editor.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
left ruler
-
Example:
-
get-editor CreateProject | get-section Script | get-left-ruler | get-ruler-column -index 1 | click-ruler -line 4
get-link
Gets link with defined text. If this link doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
link
-
Example:
-
get-window "Delete Resources" | get-link "See 3 reference(s) found." | click
get-list
Gets list with specified parameter. If this list doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
list
get-log
Returns log entries sorted by timestamp descending.
-
Parameters:
-
levels
(0, ∞) String = "false": Log entry severities to show. Any of
error
, warning
, info
, OK
, Cancel
in any letter case.
-
limit
optional Integer = 100: Number of log entries to get. Default value is 100.
-
Output:
-
Log entries
Gets the path to the section menu. If this section menu doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
path
String: Indicates the path to the item. This parameter is used by default, so
-path
word is not written at the recording of the test.
-
Output:
-
path to the section menu
-
Example:
-
get-window "Q7 Control Panel - Test" | get-toolbar | get-menu "Save As..." | click
get-nebula-grid
get-nebula-grid
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
get-object
Gets interop object from UI control.
-
Input:
-
object
Object: UI control to get object for.
-
Output:
-
Interop object.
-
Example:
-
get-view "Package Explorer" | get-tree | get-object | my-custom-tree-command
get-palette
Gets palette with specified parameter. If palette doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
palette
-
Example:
-
get-editor Diagram | get-palette | get-palette-entry CompositeLink | get-property text
get-palette-entry
Gets entry from palette
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
Palette entry
-
Example:
-
get-editor SO | get-palette | get-palette-entry Tools | get-figure "0/0" | drag-set-data
get-param
Deprecated! Please see Supercontexts page to learn more about parameters.
-
Parameters:
-
name
String: Parameter name.
-
Output:
-
Parameter value.
Gets pop-up bar of GMF element. If it doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
path
String: Indicates the path to the item. This parameter is used by default, so
-path
word is not written at the recording of the test.
-
Output:
-
pop-up bar
-
Example:
-
get-editor Diagram | get-diagram | get-edit-part -className DiagramEditPart | get-popup-bar-item | mouse-hover 16 9 -height 20 -width 30
Returns the "Preferences" menu.
-
Output:
-
Preferences menu
-
Example:
-
get-preferences-menu | click
with [get-window Preferences] {
get-tree | select "General/Content Types"
get-button Cancel | click
}
get-property
Gets property of UI control. Assertion mode and assertion window can be used for discovering of actual property names
-
Input:
-
object
Object: UI control to get property from
-
Parameters:
-
name
String: Property name
-
index
optional Integer: Property index for list values
-
raw
optional Boolean = false: When true, command returns property value
When false, command returns internal property verification handle
-
Output:
-
Property handler for further verification (like during recording), or actual property value as string, when
-raw
option is specified
-
Example:
-
get-view Tasks | get-tree | get-property itemCount | equals 1 | verify-true
get-property-tab
Gets the tab of the Properties View.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
The tab of the Properties View.
-
Example:
-
with [get-view Properties] {
get-property-tab Description | click
}
get-quick-access
Gets Eclipse 4 quick access text box.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
quick access text box
-
Example:
-
get-quick-access | set-text "Open Resource"
get-right-ruler
Gets the right ruler of editor.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
right ruler
Gets the Nebula Grid item row header (on the left of the item).
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
item row header
-
Example:
-
get-nebula-grid | get-item "Item Label" | get-row-header
get-ruler-column
Gets the ruler column of the editor.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = ""
-
Output:
-
ruler column
-
Example:
-
get-editor CreateProject | get-section Script | get-left-ruler | get-ruler-column -index 1 | click-ruler -line 4
get-section
Gets section with defined parameter. If this section doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
section
-
Example:
-
get-editor CheckSetCommand | get-section Contexts | key-type "M1+s"
get-slider
get-slider
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
get-source-connection
Gets source connection on diagram.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
path
String: Indicates the path to the item. This parameter is used by default, so
-path
word is not written at the recording of the test.
-
Output:
-
source connection
get-tab-folder
Gets all tabs of editor. If this editor doesn't contain tabs, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
all tabs of editor
-
Example:
-
get-editor SO | get-tab-folder | get-tab-item Documentation | click
get-tab-item
Gets tab of editor with defined name. If this tab doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
tab
-
Example:
-
get-editor SO | get-tab-folder | get-tab-item Documentation | click
get-table
Gets the table with specified parameter. If this table doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
table
-
Example:
-
get-editor test | get-section Contexts | get-table | get-property itemCount | equals 2 | verify-true
get-table-data
Takes a data from table or tree and returns Table
EMF object. When table or tree does not have columns, then it is assumed that there's one column named 'text'.
-
Input:
-
control
optional ControlHandler
-
Parameters:
-
includeChecked
optional Boolean = false: When true, adds a column named 'checked' which contains
true
or false
depending on checked state of row
-
excludeHidden
optional Boolean = false: When true, output table does not include columns with width=0
-
Output:
-
Table
object
-
Example:
-
get-table | get-table-data | write-csv-file "workspace:/project/file.csv"
get-target-connection
Gets target connection on diagram.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
path
String: Indicates the path to the item. This parameter is used by default, so
-path
word is not written at the recording of the test.
-
Output:
-
target connection
-
Example:
-
get-editor Diagram | get-diagram | get-edit-part -name SO | get-edit-part -name SA | get-target-connection 0 | get-property foregroundColor | equals "#F49316" | verify-true
get-text
Gets text content of a control. If this text doesn't exist, then error is returned.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Output:
-
text content of a control
-
Example:
-
get-editor "WorkbenchContext" | get-control -kind "Label" | get-text | equals "Name:" | verify-true
get-text-viewer
Gets the text viewer. If text viewer doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
text viewer
-
Example:
-
with [get-section Script | get-text-viewer] {
set-caret-pos 1 20
type-text MyText
}
get-time
Returns current time as a number of milliseconds since January, 1, 1970.
-
Output:
-
Current time as long integer
-
Example:
-
get-time | format-time -format "hh:mm:ss" | log
Gets toolbar with specified parameter. If toolbar doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
toolbar
-
Example:
-
get-window "Q7 Control Panel - Test" | get-toolbar | get-menu Save | click
get-toolbar -index 11 | key-type "M1+s"
get-tree
Gets the tree with specified parameter. If this tree doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
tree
-
Example:
-
get-view "Q7 Explorer" | get-tree | select "Q7Project/ECL Context" | double-click
get-vertical-ruler
Gets the vertical ruler of editor.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
Output:
-
vertical ruler
get-view
Gets view with defined name. If this view doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the text\name of this element. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
Output:
-
view
-
Example:
-
get-view "Q7 Explorer" | get-tree | select "Q7Project/CheckSetCommand" | double-click
get-window
Get window with defined name. If this window doesn't exist, then error is returned.
-
Input:
-
parent
optional ControlHandler
-
Parameters:
-
after
optional ControlHandler: Indicates the element after which the necessary element is present.
-
type
optional String = "": Indicates the type of a control, if there are any types.
-
index
optional Integer: Indicates the number of control in list. If element is first in list, then this parameter is not present and default is equal 0.
-
text
optional String = "": Indicates the name of this window. This parameter is used by default, so
-text
word is not written at the recording of the test.
-
from
optional String = "": Indicates the method (in the form of
"ClassName.methodName()"
) where this window is created.
-
class
optional String = "": Indicates name of the JFace Window subclass defining this window.
-
Output:
-
window
-
Example:
-
get-window "Select context" | get-table | select "ECL Context \\(Q7Project\\)" | click -default
get-workspace-location
get-workspace-location
-
Output:
-
path to workspace root
gt
Compares arguments on to one be greater then another
-
Input:
-
left
optional Object: Left argument
-
Parameters:
-
right
optional Object: Right argument
-
Output:
-
true
when left are greater then right, false
otherwise.
-
Example:
-
plus 6 4 | gt 8 | verify-true
hover-at-text-offset
Perform mouse hover at specific text position.
-
Input:
-
control
ControlHandler: Text control: editbox, editor or combo.
-
Parameters:
-
offset
Integer: Value of offset to be set. Must not be less than 0 and greater than the number of characters in the text control.
-
line
optional Integer: Value of offset to be set. Must not be less than 0 and greater than the number of characters in the text control.
-
Output:
-
value of
control
parameter
hover-ruler
Perform mouse hover at specific text position.
-
Input:
-
control
ControlHandler: Text control: editbox, editor or combo.
-
Parameters:
-
line
optional Integer
-
with
optional String = ""
-
Output:
-
value of *control* parameter
hover-text
Perform mouse hover at specific text position.
-
Input:
-
control
ControlHandler: Text control: editbox, editor or combo.
-
Parameters:
-
line
optional Integer
-
column
optional Integer
-
with
optional String = ""
-
Output:
-
value of *control* parameter
if
Based on a condition corresponds either command either from then
or else
branch.
-
Parameters:
-
condition
optional Object: Accepted values are boolean, string (
true
when case-insensitive equals to true
, false
otherwise) and number (0
for false
, true
otherwise).
-
then
optional Command: Branch being executed on
true
input. Can be omitted.
-
else
optional Command: Branch being executed on
false
input. Can be omitted.
-
Output:
-
Output of executed branch
-
Example:
-
if [get-property caption -raw | not-eq "Test" ] {
select-item
get-menu Delete | click
get-window "Delete Resources" | get-button OK | click
}
int
Converts its argument to int.
-
Input:
-
input
optional Object: Argument to be converted.
-
Output:
-
Returns integer value or fails if value cannot be converted.
true
is converted to 1
and false
is converted to 0
.
-
Example:
-
//verifies that the number of Stops it less then 3
get-view "Execution View" | get-label -after [get-label "Stops:"] | get-text | int | lt 3 | verify-true
invoke
Invokes method on Java object.
-
Input:
-
object
JavaObject: Object to call the method on.
-
Parameters:
-
name
String: Name of the method to call. As a useful addtion, there are three pseudo-methods for arrays:
get index
, set index value
and length
.
-
args
(0, ∞) JavaObject: Variable number of arguments to the method.
-
Output:
-
Value returned by method.
-
Example:
-
get-eclipse-window | get-object | invoke setSize 700 700
invoke-static
invoke-static
-
Parameters:
-
pluginId
optional String = ""
-
className
optional String = ""
-
methodName
optional String = ""
-
args
(0, ∞) JavaObject: Variable number of arguments to the method.
invoke-ui
invoke-ui
-
Input:
-
object
JavaObject: Object to call the method on.
-
Parameters:
-
name
String: Name of the method to call. As a useful addtion, there are three pseudo-methods for arrays:
get index
, set index value
and length
.
-
args
(0, ∞) JavaObject: Variable number of arguments to the method.
is-disabled
Checks if the control is disabled or not
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Output:
-
true if the control is disabled or false otherwise
-
Example:
-
get-menu "File/Save" | is-disabled | assert-true
is-disposed
Checks if the control is disposed or not
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Output:
-
true if the control is disposed or false otherwise
-
Example:
-
get-editor "WorkbenchContext" | is-disposed | verify-false
is-empty
Checks if content of control is empty
-
Input:
-
input
Object: Path to control which emptyness has to be checked
-
Output:
-
true if the content of control is empty or false otherwise
-
Example:
-
get-editor WorkbenchContext | get-section Workbench | get-editbox -after [get-label "Perspective id:"] | get-property text | is-empty | verify-false
key-type
Type key to the control.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
key
String: Key to type.
-
char
optional String = "": Character that corresponds to the *key*. In most cases this parameter is not necessary.
-
display
optional Boolean
-
times
optional Integer = 1
-
Output:
-
value of
control
parameter
-
Example:
-
get-editor "Test scenario" | get-section Script | get-editbox | key-type "M1+s"
launch
launch
-
Parameters:
-
mode
String
-
name
String
-
Output:
-
Nothing.
length
Returns count of objects got from input pipe
-
Input:
-
input
(0, ∞) Object: List of objects to get the length for
-
Output:
-
Object count
-
Example:
-
emit 1 2 3 | length | equals 3 | verify-true
// verifies that Project item has 10 children
get-view "Q7 Explorer" | get-tree | get-item Project | get-items | length | equals 10 | verify-true
let
Defines variables and evaluates body
script. Variable declarations are only visible from withing a body script and cannot be accessed after 'let' command. If some variable has -input
flag, then let
command must be used in a pipeline (see example 2).
-
Parameters:
-
vals
(0, ∞) Declaration: List of variables
-
body
optional Command: Script to be executed
-
Output:
-
An output of a
body
script
-
Example:
-
// example #1, simple usage of two variables
let [val foo "hello"]
[val bar "world!"] {
format "%s, %s" $foo $bar | show-alert
}
// example #2, using input argument
get-window "New Project" | let [val window -input] [val button OK] {
$window | get-button $button | click
}
list
Creates a new list. Also see get command to find an element by index.
-
Parameters:
-
items
(0, ∞) Object
-
Example:
-
list January Febuary March | get 1 | equals "Febuary" | verify-true
list-features
Returns list of all features.
-
Output:
-
Lists all available features.
list-install-units
Returns list of all install units.
-
Output:
-
Lists all install units.
list-launch-configurations
Returns list of launch configurations.
-
Output:
-
List of launch configurations.
list-plugins
Returns list of all plugins.
-
Parameters:
-
includeDependencies
optional Boolean = false: When true, returned plugins includes information about imported packages and bundle dependencies.
-
Output:
-
Lists all available plugins.
list-repositories
Returns list of p2 repositories.
-
Output:
-
List of p2 repositories
list-working-sets
Returns a list of all working sets available
-
Output:
-
Working set objects
-
Example:
-
list-working-sets | foreach {delete-working-set}
listen
Listens for state changes while executing commands.
-
Parameters:
-
source
String: Source to listen for, for example,
errorLog
.
-
while
Command: Commands to execute while listening for the source.
-
Output:
-
State difference before and after execution.
-
Example:
-
// assert no new errors while clicking on the button
listen errorLog {
get-button OK | click
} | assert-empty
log
Writes an entry into Eclipse log
-
Input:
-
message
optional String = "": Writes an entry into Eclipse log
-
Parameters:
-
severity
optional String = "info": Log entry severity. Can be
info
, warning
, error
, ok
, cancel
in any letter case. Default value is info
.
-
plugin
optional String = "org.eclipse.rcptt.ecl.platform": ID of plugin adding log entry. Default value is
org.eclipse.rcptt.ecl.platform
-
Output:
-
Nothing
long
Converts its argument to long.
-
Input:
-
input
optional Object: Argument to be converted.
-
Output:
-
Returns long value or fails if value cannot be converted.
true
is converted to 1L
and false
is converted to 0L
.
loop
Executes recursive looping of a body. Allows to emulate 'while' and 'for' loops while preserving variable immutability. The idea is taken from Clojure's loop/recur approach. Also see recur command.
-
Parameters:
-
vals
(0, ∞) Val: Valus which are going to be modified during iterations. All initial values must be set.
-
body
optional Command: A script to execute. Whenever script invokes recur command, an execution jumps to the beginning of loop body script.
-
Example:
-
// Example 1. returns how many times a 81 is divisible by 3
loop [val count 0] [val n 81] {
if [mod $n 3 | eq 0] {
recur [$count | plus 1] [$n | div 3]
} -else {
log [format "The answer is %d" $count] //prints 'The answer is 4'
}
}
// Example 2. deletes all elements from a tree
proc "get-my-tree" { get-view "My View" | get-tree }
proc "has-elements" {
get-my-tree | get-property itemCount -raw | int | gt 0
}
loop {
if [has-elements] {
// Selects a first top-level item and invokes "Delete" from context menu
get-my-tree | select ".*" | get-menu "Delete" | click
// Confirms a removal in popup dialog
get-window "Confirm Delete" | get-button OK | click
// Continues execution from the beginning of loop body
recur
}
}
lt
Compares arguments one are less then another
-
Input:
-
left
optional Object: Left argument
-
Parameters:
-
right
optional Object: Right argument
-
Output:
-
true
when left is less then right, false
otherwise.
-
Example:
-
plus 6 4 | lt 12 | verify-true
map
Creates a new map. Also see get command to find a value by key.
-
Parameters:
-
entries
(0, ∞) Entry: An arbitrary number of entries.
-
Example:
-
let [val myMap [map
[entry firstName "Ivan"]
[entry lastName "Inozemtsev"]]] {
log [format "%s %s" [$myMap | get firstName] [$myMap | get lastName]]
}
matches
Checks if input
matches to a regular expression value
-
Input:
-
input
Object
-
Parameters:
-
value
String
-
Example:
-
get-editor TestCase1 | get-editbox | get-property value | matches "\\d+" | verify-true
maximize
Maximize the tab folder.
See more details about How to resize a window.
-
Input:
-
control
ControlHandler: Window, view or editor.
-
Output:
-
value of
control
parameter
-
Example:
-
get-window "New Project" | maximize
measure-time
Takes the name of the counter and the command on execution. Writes to the output stream the object with fields name and duration, where the name is counterName, and duration - the execution in milliseconds.
-
Parameters:
-
label
optional String = ""
-
do
optional Command
-
Output:
-
object with fields name and the duration of execution in milliseconds
-
Example:
-
measure-time "MyCounterName" {
// some ECL script
} | constrain-max duration 2000
// fail if the operation was more than 2 seconds with a message
//Max constraint violation: 'MyCounterName' duration is 100500 which is greater than 2000.
minimize
Minimize the tab folder.
See more details about How to resize a window.
-
Input:
-
control
ControlHandler: Window, view or editor.
-
Output:
-
value of
control
parameter
-
Example:
-
get-window "New Project" | minimize
minus
returns left - right
Before performing an operation, arguments are converted to the widest type according to the following rules:
string
arguments converted to long
boolean
arguments converted to long
(1 for true
and 0 for false
)
- If one of arguments is
double
, converts the other one to double
- If one of arguments is
float
, converts the other one to float
- If one of arguments is
long
, converts the other one to long
- Otherwise (in case of
byte
, char
, or short
) converts both arguments to int
-
Input:
-
left
optional Object: Left argument
-
Parameters:
-
right
optional Object: Right argument
-
Example:
-
minus 8 5 | equals 3 | verify-true
mod
returns left % right
Before performing an operation, arguments are converted to the widest type according to the following rules:
string
arguments converted to long
boolean
arguments converted to long
(1 for true
and 0 for false
)
- If one of arguments is
double
, converts the other one to double
- If one of arguments is
float
, converts the other one to float
- If one of arguments is
long
, converts the other one to long
- Otherwise (in case of
byte
, char
, or short
) converts both arguments to int
-
Input:
-
left
optional Object: Left argument
-
Parameters:
-
right
optional Object: Right argument
-
Example:
-
mod 11 3 | equals 2 | verify-true
mouse
Sends a mouse event to control. Returns the same control, so that mouse commands can be chained: ... | get-text "Foo" | mouse down -button Right | mouse up -buton Right
-
Input:
-
control
optional ControlHandler
-
Parameters:
-
event
optional String = "": Mouse event:
- up
- down
- move
- enter
- exit
- hover
- double-click
-
button
optional String = "Left": Mouse button: Left, Right or Middle
-
with
optional String = "": Modfier keys and holded mouse buttons joined by '+', for example 'M1+M2', or 'M3'.
-
count
optional Integer = -1: The 'count' to be set in mouse event. When omitted, reasonable default is used
-
x
optional Integer = -2147483648: The 'x' coordinate of mouse event. Can be omitted
-
y
optional Integer = -2147483648: The 'y' coordinate of mouse event. Can be omitted
-
Output:
-
value of control parameter
mouse-action
Emulates mouse actions
-
Input:
-
control
ControlHandler: Canvas, edit part or figure.
-
Parameters:
-
x
Integer: X coordinate relative to left top corner of the control.
-
y
Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
height
optional Integer: Height of the control.
-
width
optional Integer: Width of the control.
mouse-double-click
Emulates mouse double click on the control.
-
Input:
-
control
ControlHandler: Canvas, edit part or figure.
-
Parameters:
-
x
Integer: X coordinate relative to left top corner of the control.
-
y
Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
height
optional Integer: Height of the control.
-
width
optional Integer: Width of the control.
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-palette-entry "Try/Catch/Finally"] {
  mouse-release 32 18 button1 524288 -height 23 -width 125
  mouse-press 32 18 button1 -height 23 -width 125
  mouse-double-click 32 18 button1 -height 23 -width 125
  mouse-release 32 18 button1 524288 -height 23 -width 125
}
mouse-drag
Emulates mouse drag on the control.
-
Input:
-
control
ControlHandler: Canvas, edit part or figure.
-
Parameters:
-
x
Integer: X coordinate relative to left top corner of the control.
-
y
Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
height
optional Integer: Height of the control.
-
width
optional Integer: Width of the control.
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-editor Test | get-diagram] {
  mouse-press 77 311 button1 -height 689 -width 413
  mouse-drag 77 311 -height 689 -width 413
}
mouse-enter
Emulates mouse entering to the control.
-
Input:
-
control
ControlHandler: Canvas, edit part or figure.
-
Parameters:
-
x
Integer: X coordinate relative to left top corner of the control.
-
y
Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
height
optional Integer: Height of the control.
-
width
optional Integer: Width of the control.
-
Output:
-
value of
control
parameter
mouse-exit
Emulates mouse leaving from the control.
-
Input:
-
control
ControlHandler: Canvas, edit part or figure.
-
Parameters:
-
x
Integer: X coordinate relative to left top corner of the control.
-
y
Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
height
optional Integer: Height of the control.
-
width
optional Integer: Width of the control.
-
Output:
-
value of
control
parameter
mouse-hover
Emulates mouse hovering over the control.
-
Input:
-
control
ControlHandler: Canvas, edit part or figure.
-
Parameters:
-
x
Integer: X coordinate relative to left top corner of the control.
-
y
Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
height
optional Integer: Height of the control.
-
width
optional Integer: Width of the control.
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-edit-part "0/0/1/0/1/0/1/0"] {
  mouse-release 13 17 button1 524288 -height 22 -width 88
  mouse-move 14 16 -height 22 -width 88
  mouse-hover 14 16 -height 22 -width 88
}
mouse-move
Emulates mouse move over the control.
-
Input:
-
control
ControlHandler: Canvas, edit part or figure.
-
Parameters:
-
x
Integer: X coordinate relative to left top corner of the control.
-
y
Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
height
optional Integer: Height of the control.
-
width
optional Integer: Width of the control.
-
Output:
-
value of
control
parameter
-
Example:
-
get-editor Test | get-diagram | get-figure "0/1/0/0/0/1" | mouse-move 62 167 -height 235 -width 525
mouse-press
Emulates mouse press on the control.
-
Input:
-
control
ControlHandler: Canvas, edit part or figure.
-
Parameters:
-
x
Integer: X coordinate relative to left top corner of the control.
-
y
Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
height
optional Integer: Height of the control.
-
width
optional Integer: Width of the control.
-
Output:
-
value of
control
parameter
-
Example:
-
get-editor Test | get-diagram | mouse-press 77 311 button1 -height 689 -width 413
mouse-release
Emulates mouse release on the control.
-
Input:
-
control
ControlHandler: Canvas, edit part or figure.
-
Parameters:
-
x
Integer: X coordinate relative to left top corner of the control.
-
y
Integer: Y coordinate relative to left top corner of the control.
-
button
optional Button: Mouse button pressed. Must be one of followings: none, button1, button2, button3.
-
mask
optional String = ""
-
height
optional Integer: Height of the control.
-
width
optional Integer: Width of the control.
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-editor Test | get-diagram] {
  mouse-press 77 311 button1 -height 689 -width 413
  mouse-release 77 311 button1 -height 689 -width 413
}
mult
returns left * right
Before performing an operation, arguments are converted to the widest type according to the following rules:
string
arguments converted to long
boolean
arguments converted to long
(1 for true
and 0 for false
)
- If one of arguments is
double
, converts the other one to double
- If one of arguments is
float
, converts the other one to float
- If one of arguments is
long
, converts the other one to long
- Otherwise (in case of
byte
, char
, or short
) converts both arguments to int
-
Input:
-
left
optional Object: Left argument
-
Parameters:
-
right
optional Object: Right argument
-
Example:
-
mult 5 7 | equals 35 | verify-true
not
Return !value
-
Input:
-
left
optional Object: Left argument
-
Output:
-
true
when value is false, false
otherwise.
-
Example:
-
minus 10 7 | equals 2 | not | verify-true
not-eq
Compares arguments are different
-
Input:
-
left
optional Object: Left argument
-
Parameters:
-
right
optional Object: Right argument
-
Output:
-
false
when args are equal, true
otherwise.
-
Example:
-
int 9 | not-eq 10 | verify-true
open-declaration
Perform open declaration command in the current text position (CTRL+Left click)
-
Input:
-
control
ControlHandler: Text control: editbox, editor or combo.
-
Output:
-
value of *control* parameter
-
Example:
-
with [get-editor t | get-section Script | get-text-viewer] {
set-caret-pos 4 3
open-declaration
}
or
Computes the result of logical Or operation for passed arguments.
-
Parameters:
-
args
(2, ∞) Object: Arguments to compute on.
-
Output:
-
true
or false
.
-
Example:
-
with [get-view "Q7 Explorer" | get-tree] {
if [or[get-item Project | get-property caption -raw | eq Project][get-property itemCount -raw | eq 1]] {
log -message "One of two verifications passed"
}
}
parse-time
Reads a string from input pipe and parses it accoridng to a given format string.
-
Input:
-
input
String: String representation of date.
-
Parameters:
-
format
optional String = ""
-
Output:
-
Timestamp value (as a number of milliseconds since January, 1, 1970)
plus
returns left + right
Before performing an operation, arguments are converted to the widest type according to the following rules:
string
arguments converted to long
boolean
arguments converted to long
(1 for true
and 0 for false
)
- If one of arguments is
double
, converts the other one to double
- If one of arguments is
float
, converts the other one to float
- If one of arguments is
long
, converts the other one to long
- Otherwise (in case of
byte
, char
, or short
) converts both arguments to int
-
Input:
-
left
optional Object: Left argument
-
Parameters:
-
right
optional Object: Right argument
-
Example:
-
plus 10 3 | equals 13 | verify-true
int 8 | plus 2 | equals 10 | assert-true "8 + 2 not equals 10!"
proc
Declares a new procedure in a context of current ECL session, which can later be accessed as a usual command.
-
Parameters:
-
name
optional String = "": Procedure name. Must be unique in a context of current ECL session
-
vals
(0, ∞) Declaration
-
body
optional Command
-
Output:
-
An output of a
body
script
-
Example:
-
// example 1
// declaration:
proc click-button [val window] [val button] {
get-window $window | get-button $button | click
}
// usage
click-button "New Project" "Cancel"
// example #2, using input argument and default value
// declaration:
proc set-text-after-label [val parent -input] [val label] [val text ""] {
$parent | get-editbox -after [get-label $label] | set-text $text
}
// usage:
with [get-window "New Project"] {
set-text-after-label "Name:" "Sample Project"
}
get-editor | set-text-after-label "Text"
read-csv-file
Parses given csv file. Fails if file is not found or format is invalid.
Learn more about Asserting the whole table contents.
-
Parameters:
-
uri
optional String = "": URI to a file to read. Currently supported schemes are workspace:/ for files in workspace and file:/ for files on local file system
-
Output:
-
Table
EMF Object.
-
Example:
-
with [get-window Preferences] {
get-tree | select "Java/Installed JREs"
get-table | get-table-data | eq [read-csv-file "workspace:/assertData/table.csv"] |
assert-true "Data in table does not match input file"
get-button OK | click
}
//Let's say we need to write ErrorLog info to csv file 'table.csv'.
//ECL script should look like this:
get-view "Error Log" | get-tree | expand-all
get-view "Error Log" | get-tree | get-table-data | write-csv-file "workspace:/MyProject/AssertData/table.csv
//Note:
//Expand-allcommand may be useful in case of hierarchical tree - otherwise non-expanded levels won't be written.
//You should have MyProject/AssertData on your workspace (you may do it easily with a workspace context) to let you csv file to be created there.
//In case you want to specify which columns/rows should be written you may use
//select-columns/exclude-columns and select-rows/exclude-rows commands:
get-view "Error Log" | get-tree | get-table-data | select-columns "Message" | write-csv-file "workspace:/MyProject/AssertData/table.csv"
get-view "Error Log" | get-tree | get-table-data | exclude-columns "Message" "Plug-in" | write-csv-file "workspace:/MyProject/AssertData/table.csv"
get-view "Error Log" | get-tree | get-table-data | select-rows -column "Message" -value "Execution of early startup handlers completed." | write-csv-file "workspace:/MyProject/AssertData/table.csv"
//To compare table data to already written csv file you may use read-csv-file command:
get-view "Error Log" | get-tree | get-table-data | select-columns "Plug-in" | eq [read-csv-file "workspace:/MyProject/AssertData/table.csv"] | assert-true "Data in table does not match input file"
read-lines
Reads lines from file identified by uri and writes them one-by-one into output pipe
-
Input:
-
uri
String: URI to read lines from. Currently supported schemes are workspace:/ for files in workspace and file:/ for files on local file system
-
Example:
-
//Displays alert with lines count
show-alert [concat "The number of lines is "[read-lines -uri "workspace:/Project/Folder/file.txt" | length | str]]
read-properties
Parses given .properties file. Fails if file is not found or format is invalid
-
Parameters:
-
uri
optional String = "": URI to a file to read. Currently supported schemes are workspace:/ for files in workspace and file:/ for files on local file system
-
Output:
-
ECL map with values from properties file
-
Example:
-
...get-item "General Registers/pc" | get-property "values[\'Value\']"
| matches [format "%s.*" [read-properties -uri "file:/C:/Users/Administrator/Desktop/p.properties" | get myKey]] | verify-true
recur
Returns an execution to the beginning of loop command. Cannot be used outside of a loop.
-
Parameters:
-
values
(0, ∞) Object: A list of new values for variables, declared in
loop
command. Value count must exactly match to corresponding val count of a loop
command.
-
Example:
-
// calc and show a sum of ints from 3 to 10
loop [val result 0] [val i 3] {
if [$i | eq 10] {
show-alert [str [$result | plus $i]]
} -else {
recur [$result | plus $i] [$i | plus 1]
}
}
remove-repository
Removes p2 repository.
-
Parameters:
-
uri
optional String = ""
-
Output:
-
nothing
repeat
Execute specified command multiple times.
-
Parameters:
-
index
optional Val: Optional value declaration to hold a current index
-
times
optional Integer = 1
-
command
optional Command
-
delay
optional Integer = 0
-
Output:
-
Aggregated command output
-
Example:
-
//creates file0, file1, file2, file3, file4
repeat [val index] -times 5 -command {
get-view "Q7 Explorer" | get-tree | select "Project/Folder" | get-menu "New/Other..." | click
with [get-window New] {
get-tree | select "General/File"
get-button "Next >" | click
}
with [get-window "New File"] {
get-editbox -after [get-label "File name:"] | set-text [concat "file" [$index | str]]
get-button Finish | click
}
}
repeat-with
Takes list of commands from input pipe and single command as argument and executes them in following order:
command-from-input-1 | command-from-arg
command-from-input-2 | command-from-arg
...
-
Input:
-
commands
(0, ∞) Object
-
Parameters:
-
command
optional Command
-
Output:
-
Aggregated output of command from argument
-
Example:
-
// executes commands:
// echo 1 | gt 2
// echo 2 | gt 2
// echo 3 | gt 2
// output: false, false, true
emit { echo 1} { echo 2} { echo 3} | repeat-with { gt 2 }
restart-aut
restart-aut
restore
Restore the tab folder.
-
Input:
-
control
ControlHandler: Window, view or editor.
-
Output:
-
value of
control
parameter
-
Example:
-
get-view "Q7 Explorer" | minimize
get-view "Q7 Explorer" | restore
save-screenshot
Saves the screenshot.
-
Parameters:
-
out
optional String = ""
-
Output:
-
Nothing
-
Example:
-
get-eclipse-window | get-object | save-screenshot [substitute-variables "${workspace_loc}/images/actual.png"]
select
Selects items.
-
Input:
-
control
ControlHandler: Table, list or tree.
-
Parameters:
-
items
(1, ∞) JavaObject: Path of item to select.
-
all
optional Boolean = false: If true, command selects all items matched by provided regular expression. For Example,
get-tree | select "Foo.*/Bar.*" -all
will select all items starting with "Bar", if their parents starts with "Foo".
-
column
optional String = ""
-
Output:
-
value of
control
parameter
-
Example:
-
get-view "Q7 Explorer" | get-tree | select "TestQ7Prj/Test scenario" | double-click
select-columns
Takes a table from input and returns the table containing only columns passed into columns
argument.
-
Input:
-
table
optional Table: Table to take columns from
-
Parameters:
-
columns
(0, ∞) String = "": Column names to take from table. If given column name is not present in input table, command fails
-
Output:
-
Copy of input table object with only columns with names listed in
columns
-
Example:
-
get-view "Error Log" | get-tree | get-table-data | select-columns "Message" | write-csv-file "workspace:/MyProject/AssertData/table.csv"
select-grid-range
Selects item or cell range.
-
Input:
-
control
ControlHandler: Nebula Grid.
-
Parameters:
-
from
JavaObject: Path of item of item cell from where the selection begins.
-
to
JavaObject: Path of item or item cell where the selection ends.
-
Output:
-
value of
control
parameter
-
Example:
-
get-nebula-grid | select "From Item" "To Item"
get-nebula-grid | select [get-item "From Item" | get-item-cell -column "Col1"] [get-item "To Item" | get-item-cell -column "Col2"]
select-item
Takes a table or tree item and sets it as a selection of tree or table. Usage: get-tree | get-item "foo" | select-item
-
Input:
-
control
optional ControlHandler
-
Output:
-
input item
select-range
Sets the selection to the range specified by the given offset and length. If specified four parameters sets the selection by start line, offset in start line, end line and offset in end line.
-
Input:
-
control
ControlHandler: Text control: editbox, editor or combo.
-
Parameters:
-
line
optional Integer
-
column
optional Integer
-
endLine
optional Integer
-
endColumn
optional Integer
-
Output:
-
value of *control* parameter
-
Example:
-
with [get-editor "file.txt" | get-text-viewer] {
select-range 1 2 5 8
get-menu Cut | click
}
select-rows
Takes a table from input and returns the table with rows filtered by column and criteria.
-
Input:
-
table
optional Table: Table to take columns from
-
Parameters:
-
column
optional String = "": Column named to filter rows by.
-
value
optional String = "": Pattern to match rows to.
-
match
optional RowMatchMode: Describes the matching behaviour for rows.
- glob – wildcard matching
- exact – value should be equals to pattern
- regext – value must match java regular expression
-
Output:
-
Copy of input table object with filtered rows.
-
Example:
-
select-rows -column "columnName" -value "value" -match exact|glob|regex
set-caret-pos
Sets the text offset.
For specified line.
-
Input:
-
control
ControlHandler: Text control: editbox, editor or combo.
-
Parameters:
-
line
optional Integer
-
column
optional Integer
-
Output:
-
value of *control* parameter
-
Example:
-
with [get-editor "q7enterprise.license" | get-text-viewer] {
set-caret-pos 3 5
}
set-dialog-result
Emulates result returning from native dialog.
-
Parameters:
-
kind
String: Must be one of followings: File, Folder, MessageBox, Font, Color
-
result
(0, ∞) String = "": String presentation of returned value (platform specific).
-
Output:
-
nothing
-
Example:
-
set-dialog-result File "/Users/Ulik_MacAir/Downloads/MyLicense.license"
get-menu "File/Open File..." | click
set-focus
Sets the focus in specified editbox.
-
Input:
-
control
optional ControlHandler
-
Output:
-
Nothing
-
Example:
-
get-view "Q7 Testing" | get-section "CellEdit Tree Test" | get-tree | get-editbox | set-focus
set-param
Deprecated! Please see Supercontexts page to learn more about parameters.
-
Parameters:
-
name
String: Parameter name.
-
value
String: New parameter value.
-
Output:
-
Value to which parameter was set.
set-position
Sets position of a table column.
-
Input:
-
control
optional ControlHandler
-
Parameters:
-
index
Integer
-
Output:
-
value of
control
parameter
-
Example:
-
get-nebula-grid | get-column-header Name | set-position 4
set-q7-option
Sets Q7 runtime option.
-
Parameters:
-
key
String:
Available keys:
- jobDebugjobTimeout Eclipse job debug plugin jobs timeout (def: 300000 ms)
- jobSleepingStepTime Step in step mode (def: 200 ms)
- jobSleepingStepTimeout Stepping job timeout (def: 120000 ms)
- jobTreatAsSleepingTimeout Enable Job step mode timeout (def: 10000 ms)
- jobHangTimeout Job skip timeout (def: 30000 ms)
- jobScheduleDelayedMaxtime Wait for jobs with delay less timeout (def: 600 ms)
- eclExecutionDelay Wait for time between each ECL command (def: 0 ms)
- workspaceClearForceGc Forces garbage collection on workspace cleanup (def: true)
-
value
String
-
Example:
-
set-q7-option eclExecutionDelay 0
set-text
Sets text content of the control.
-
Input:
-
control
ControlHandler: Text control: editbox, editor or combo.
-
Parameters:
-
text
String: Text to set.
-
Output:
-
value of
control
parameter
-
Example:
-
get-window Properties | get-combo -after [get-label "Priority:"] | set-text High
set-text-offset
Sets the text offset.
For specified line.
-
Input:
-
control
ControlHandler: Text control: editbox, editor or combo.
-
Parameters:
-
value
Integer: Value of offset to be set. Must not be less than 0 and greater than the number of characters in the text control.
-
line
optional Integer: Value of offset to be set. Must not be less than 0 and greater than the number of characters in the text control.
-
Output:
-
value of
control
parameter
-
Example:
-
get-window "Q7 Control Panel - Test" | get-editbox | set-text-offset 8 0
set-text-selection
Sets the selection to the range specified by the given offset and length. If specified four parameters sets the selection by start line, offset in start line, end line and offset in end line.
-
Input:
-
control
ControlHandler: Text control: editbox, editor or combo.
-
Parameters:
-
offset
Integer: Zero-based selection starting position. Must be in
0..length-1
range
-
length
optional Integer: Length of selection. Must not be less that zero.
-
startLine
optional Integer: For multiline text boxes the starting line of a selection. If set, then the
offset
value will be relative to given line.
-
endLine
optional Integer: For multiline textboxes the ending line of a selection.
-
endOffset
optional Integer: Selection end offset relative to
endLine
. Don't use this argument along with length
argument.
-
Output:
-
value of
control
parameter
-
Example:
-
get-editor Q7Project | get-section Script | get-editbox | set-text-selection -offset 0 -startLine 1 -endLine 4 -endOffset 1
set-value
Set value of the control.
-
Input:
-
control
ControlHandler: Text control: editbox, editor or combo.
-
Parameters:
-
value
String: Text to set.
-
Example:
-
get-combo -after [get-label "Mouse move recording mode"] | set-value Never
set-width
Sets width of a table column.
-
Input:
-
control
optional ControlHandler
-
Parameters:
-
width
Integer
-
Output:
-
value of
control
parameter
-
Example:
-
get-nebula-grid | get-column-header Name | set-width 256
show-alert
Displays a message.
-
Input:
-
message
optional String = "": Message to display.
-
Output:
-
Nothing.
-
Example:
-
show-alert "Hello!"
show-content-assist
Shows content assist.
-
Input:
-
control
ControlHandler: Must be editor.
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-editor t | get-section Script | get-text-viewer] {
set-caret-pos 1 1
type-text "get-"
show-content-assist
}
show-tab-list
Show the list of tabs from tab folder.
-
Input:
-
control
ControlHandler: Window, view or editor.
-
Output:
-
value of
control
parameter
-
Example:
-
get-editor SO | show-tab-list
site-injection
site-injection
-
Parameters:
-
uri
String
-
unit
(0, ∞) String = ""
sort-by
Sorts list of objects from input stream by defined field.
-
Parameters:
-
field
optional String = ""
-
Output:
-
sorted list of objects
-
Example:
-
list-working-sets | sort-by -field name | foreach {get name | log}
split
split
-
Input:
-
str
optional String = ""
-
Parameters:
-
sep
optional String = ""
-
trimResults
optional Boolean = false
-
omitEmptyStrings
optional Boolean = false
-
Example:
-
str "1, 2, 3, 4, 5" | split -sep "," -trimResults | foreach [val item]{
$item | log
}
start-time-measure
Start measuring time with a certain counter name.
-
Parameters:
-
label
optional String = ""
-
Output:
-
nothing
-
Example:
-
start-time-measure MyCounter
//Some ECL script
stop-time-measure MyCounter | constrain-max duration 2000
stop-time-measure
Finishes measuring time. Writes to the output stream the object with fields name and duration, where the name is counterName, and duration - the execution in milliseconds.
-
Parameters:
-
label
optional String = ""
-
Output:
-
object with fields name and the duration of execution in milliseconds
-
Example:
-
start-time-measure MyCounter
//Some ECL script
stop-time-measure MyCounter | constrain-max duration 2000
str
Converts its argument to string.
-
Input:
-
input
optional Object: Argument to be converted.
-
Output:
-
Returns string value or fails if value cannot be converted.
-
Example:
-
//Types "2" into log
div 10 5 | str | log
substitute-variables
substitute-variables
-
Parameters:
-
expression
optional String = "": expression referencing variables
-
ignoreUndefined
optional Boolean = false: whether a reference to an undefined variable is to be considered an error (i.e. throw an exception)
-
Output:
-
expression with variable references replaced with variable values
switch
Reads object from input pipe or input
parameter and executes a case
part with matching condition
parameter (if any) sending input
parameter as an input. If no case
matched, the default block (if any) will be executed.
-
Input:
-
input
Object: The input object to match.
-
Parameters:
-
items
(1, ∞) Case: One or more
case
blocks. Block with a condition matching the input will be executed.
-
default
optional Command: Optional parameter. The block which will be executed in case no
case
block is executed.
-
Output:
-
An output of executed block (
case
command or -default
block). If nothing is executed, no output will be produced.
-
Example:
-
list 1 2 3 | get 0 | switch [case 1 {
echo "Found 1"
}] [case 2 {
echo "Found 2"
}] - default {
echo "Unknown item"
} | equals "Found 1" | verify-true
///////////
proc "set-schedules-view-value" [val view] [val date] [val direction] {
// First, determine View to set desired Date value in
get-view Schedules | get-section $view | get-property "getText()" -raw | switch
[case "Year View" {
echo "The YEAR View is being Evaluated!"
// Second, determine if the desired Date is already set
set-view-value $view "\d\d\d\d" $date $direction }]
[case "Month View" {
echo "The MONTH View is being Evaluated!"
set-view-value $view "(January|February|March|April|May|June|July|August|September|October|November|December), \d+" $date $direction}]
[case "Week View" {
echo "The WEEK View is being Evaluated!"
set-view-value $view "Week \d+, \d+" $date $direction }]
[case "Day View" {
echo "The DAY View is being Evaluated!"
set-view-value $view "(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), .*? \d+, \d+" $date $direction}]
-default {
echo "The View Value specified in NOT Supported!"
}
}
take-screenshot
Takes a screenshot and attaches it to test report.
Note: please make sure you enabled "Include 'trace' and 'take-screenshot' in HTML report" option (Q7 Advanced options/Reporting).
-
Parameters:
-
message
optional String = "": Optional message to be attached to the screenshot.
-
Output:
-
Nothing.
to-control-handle
Gets UI control handle from widget.
-
Input:
-
widget
JavaObject: Widget to get UI control for.
-
Output:
-
UI control handle.
to-list
Loads whole input pipe and returns a single EclList object, containing it.
-
Example:
-
emit 1 2 3 | to-list // same as list 1 2 3
emit 1 2 3 | to-list | to-list // same as list [list 1 2 3]
trace
Appends a tracing message to Q7 report collected during execution, so that it can be used later in report renderer.
-
Parameters:
-
message
optional String = ""
-
Example:
-
trace "Project created"
trace [get-view "Package Explorer" | get-tree | get-item "Other Projects/sample" | get-property "getData().isOpen()" -raw]
try
Try to execute command, retry times with delay if command are failed.
Execute catch if all operations is not succesfull. Execute finally in anyway.
-
Parameters:
-
command
optional Command
-
catch
optional Command
-
finally
optional Command
-
times
optional Integer = 1
-
delay
optional Integer = 0
-
Output:
-
return's -command output if command is successed.
-
Example:
-
try -times 10 -delay 100 -command {
// some ECL scripts
}
type-command-key
Type key to the control.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
commandId
String
-
Output:
-
value of
control
parameter
type-text
Types text to the control.
-
Input:
-
control
ControlHandler: Any control is appropriate.
-
Parameters:
-
text
String: Text to type.
-
display
optional Boolean
-
Output:
-
value of
control
parameter
-
Example:
-
get-editor "Test scenario" | get-section Script | get-editbox | type-text "wait 200"
uncheck
Unchecks the control.
-
Input:
-
control
ControlHandler: Item of table, list or tree.
-
Output:
-
value of
control
parameter
-
Example:
-
with [get-editor Wb | get-section Workbench] {
get-button "Close all modal dialogs" | uncheck
get-button "Clear clipboard" | uncheck
}
unfocus
Sets the focus in specified editbox.
-
Input:
-
control
optional ControlHandler
-
Output:
-
Nothing
-
Example:
-
get-view "Q7 Testing" | get-section "CellEdit Tree Test" | get-tree | get-editbox | set-focus
unsupported
unsupported
-
Parameters:
-
desc
optional String = ""
update-all
update-all
update-feature
Updates feature with defined name.
-
Parameters:
-
id
optional String = ""
-
Output:
-
nothing
uri-from-path
uri-from-path
-
Input:
-
path
String: Platform-dependednt filesystem path.
-
Output:
-
URI string. Platform independent (can be used on every OS).
-
Example:
-
get-file [uri-from-path "C:\windows"] | get exists
val
Creates a new variable declaration. This command can be used only with let and proc.
-
Parameters:
-
name
optional String = "": Variable name. Later this name can be used to refer to a variable value by prepending a dollar sign, i.e. $varName. If variable with the same name already defined in outer scope, then it will be hidden by inner variable with the same name.
-
value
optional Object: Variable value. When variable is defined in proc block, this value denotes the default parameter value.
-
input
optional Boolean = false: An option to indicate that variable value should be taken from input pipe.
-
Output:
-
An internal object, describing a variable
-
Example:
-
let [val button [get-button OK]] {
$button | click
}
verify-error
Checks input
conditions.
If the specified condition is not met (for example, the object is not returned), the verification is passed.
If the condition is met (for example, the object is selected), the verification is failed.
-
Parameters:
-
command
Command
-
Example:
-
get-view "Project Explorer" | get-tree | verify-error {get-item "TestProject"}
verify-false
Checks input
condition's falsity. If falsity is not confirmed, then error is returned
-
Input:
-
condition
Object:
input
condition that has to be false
-
Example:
-
get-editor "Test scenario" | get-section Script | get-editbox | get-property value | equals test | verify-false
verify-true
Checks input
condition's verity. If verity is not confirmed, then error is returned
-
Input:
-
condition
Object:
input
condition that has to be true
-
Example:
-
get-editor "Test scenario" | get-section Script | get-editbox | get-property value | equals test | verify-true
wait
Suspend execution for a given number of milliseconds.
-
Parameters:
-
ms
Integer: Number of milliseconds. Must be integer value greater than zero.
-
Output:
-
nothing
-
Example:
-
wait 100
wait-until-eclipse-is-ready
Suspend execution until Eclipse is ready.
-
Output:
-
nothing
-
Example:
-
get-menu "File/Restart" | click
wait-until-eclipse-is-ready
get-view "Q7 Explorer" | get-tree | select Project
with
Executes a do
script by passing given object
to each command inside do
. The primary use case for this command is to extract a common prefix for a sequence of commands.
-
Parameters:
-
object
Object
-
do
Command
-
Output:
-
Output of a
do
command
-
Example:
-
get-view "Package Explorer" | get-button "Collapse All (M1+M2+Numpad_Divide)" | click
get-view "Package Explorer" | get-button "Link with Editor" | click
// can be shorten to:
with [get-view "Package Explorer"] {
get-button "Collapse All (M1+M2+Numpad_Divide)" | click
get-button "Link with Editor" | click
}
write-csv-file
Writes given table into csv file. Fails if file is not accessible.
Learn more about Asserting the whole table contents.
-
Input:
-
table
optional Table: Table to write
-
Parameters:
-
uri
optional String = "": URI to write CSV data to. Currently supported schemes are workspace:/ for files in workspace and file:/ for files on local file system
-
Output:
-
The value of
table
argument.
-
Example:
-
with [get-window Preferences] {
get-tree | select "Java/Installed JREs"
get-table | get-table-data | write-csv-file "workspace:/assertData/table.csv"
get-button OK | click
}
//Let's say we need to write ErrorLog info to csv file 'table.csv'.
//ECL script should look like this:
get-view "Error Log" | get-tree | expand-all
get-view "Error Log" | get-tree | get-table-data | write-csv-file "workspace:/MyProject/AssertData/table.csv
//Note:
//Expand-allcommand may be useful in case of hierarchical tree - otherwise non-expanded levels won't be written.
//You should have MyProject/AssertData on your workspace (you may do it easily with a workspace context) to let you csv file to be created there.
//In case you want to specify which columns/rows should be written you may use
//select-columns/exclude-columns and select-rows/exclude-rows commands:
get-view "Error Log" | get-tree | get-table-data | select-columns "Message" | write-csv-file "workspace:/MyProject/AssertData/table.csv"
get-view "Error Log" | get-tree | get-table-data | exclude-columns "Message" "Plug-in" | write-csv-file "workspace:/MyProject/AssertData/table.csv"
get-view "Error Log" | get-tree | get-table-data | select-rows -column "Message" -value "Execution of early startup handlers completed." | write-csv-file "workspace:/MyProject/AssertData/table.csv"
//To compare table data to already written csv file you may use read-csv-file command:
get-view "Error Log" | get-tree | get-table-data | select-columns "Plug-in" | eq [read-csv-file "workspace:/MyProject/AssertData/table.csv"] | assert-true "Data in table does not match input file"
write-lines
Reads objects from input pipe and writes them into file line-by-line as strings
-
Parameters:
-
uri
optional String = "": URI to write lines to. Currently supported schemes are workspace:/ for files in workspace and file:/ for files on local file system
-
append
optional Boolean = false: Whether to append given lines into file. Default value is false
-
Example:
-
//writes a list of launch configuration into a file line-by-line
list-launch-configurations | write-lines -uri "workspace:/Project/Folder/file.txt"
// appends "New line" into a file.
str "New line" | write-lines -uri "workspace:/Project/Folder/file.txt" -append