Actions
Abstract actions recognized through Natural Language Processing
Concordia Language contains a set of meta-actions that can be used by different testing frameworks for generating test scripts. Concordia Compiler uses Intent Recognition (yes, like chatbots do) to understand sentences and extract the desired action to perform. Later these actions are sent to testing frameworks for conversion into commands.
Concordia actions are recognized in Variants, Test Cases, and Test Events.
The following list presents the available actions and gives some examples on how to use them in sentences. We expect that you do not have to memorize them but, instead, see the things you can do. Try to write the sentences the way you speak, using first person singular (I) . When there is a UI Element in the sentence, embrace it with { and }, like {this}. The compiler will tell you whether it cannot understand some sentence you wrote. If you think it should have understood something, please tell us. We'll try to augment the compiler's vocabulary to understand it the next time.

accept

Accepts a browser message or app message.

accept + alert

1
When I accept the alert
Copied!

accept + alert + message

1
When I accept the alert "Hello"
Copied!

accept + confirm

1
When I accept the confirmation
Copied!

accept + confirm + message

1
When I accept the confirmation "Continue?"
Copied!

accept + popup

1
When I accept the popup
Copied!

accept + popup + message

1
When I accept the popup "Hello"
Copied!

accept + prompt

1
When I accept the prompt
Copied!

accept + prompt + message

1
When I accept the prompt "Continue ?"
Copied!

amOn

Indicates a webpage or screen in which it is expected to be at.

amOn + value

1
Given that I am on "http://concordialang.org"
Copied!

append

Adds a value to an element.

append + number + target

1
When I append "Foo" to {Foo}
2
and I append "Bar" to <#foo>
Copied!

append + value + target

1
When I append 100 to {Bar}
2
and I append 200 to <#foo>
Copied!

attachFile

Attaches a file. It selects a file and confirms its choice (e.g., clicks Open).

attach + file + value + target

1
When I attach the file "/path/to/file" to {Foo}
2
and I attach the file "/path/to/file" to <#bar>
Copied!

cancel

Cancels a browser message or app message.

cancel + alert

1
When I cancel the alert
Copied!

cancel + confirm

1
When I cancel the confirmation
Copied!

cancel + popup

1
When I cancel the popup
Copied!

cancel + prompt

1
When I cancel the prompt
Copied!

check

Checks a checkbox.

check + target

1
When I check {Foo}
2
and I check <#bar>
Copied!

clear

clear + target

Empties an input field.
1
When I clear {Foo}
2
and I clear <#bar>
Copied!
Clears a cookie by its name.
1
When I clear the cookie "foo"
Copied!

click

Clicks on something in the screen.

click + target

1
When I click {Foo}
2
and I click <#bar>
Copied!

click + value

1
When I click "Foo"
Copied!

close

Closes a tab or an app.

close + current tab

1
When I close the current tab
Copied!

close + other tabs

1
When I close the other tabs
Copied!

close + app

The next sentence is for mobile only:
1
When I close the app
Copied!

connect

Connects to a database.
The next sentence is for Test Events only:
1
When I connect to the database [TestDB]
Copied!

disconnect

Disconnects from a database.
The next sentence is for Test Events only:
1
When I disconnect from the database [TestDB]
Copied!

doubleClick

Performs a double click on something.

doubleClick + target

1
When I double click {Foo}
2
and I double click <#bar>
Copied!

doubleClick + value

1
When I double click "Foo"
Copied!

drag

Drags and drops something to a widget.

drag + target + target

1
When I drag {Foo} to <#bar>
Copied!

fill

Indicates that a field is being filled. If desired, a value can be given. Otherwise, a value will be generated for the corresponding Test Case.

fill + target

1
When I fill {Foo}
2
and I inform {Foo}
3
and I enter {Foo}
4
and I type {Foo}
Copied!

fill + target + with + value or number

1
When I fill {Foo} with "foo"
2
and I fill <#bar> with "bar"
3
and I fill <#bar> with 3.1415
Copied!

fill + value + inside + target

1
When I type "bar" in {Foo}
2
and I type "foo" in <#bar>
Copied!

hide

Hides something.

hide + keyboard

Hides the device's keyboard.
The next sentence is for mobile only:
1
When I hide the keyboard
Copied!

install

Installs an app.

install + app + value

The next sentence is for mobile only:
1
When I install the app "com.example.android.myapp"
Copied!

maximize

Maximizes a window or the browser.

maximize + window

1
When I maximize the window
Copied!

move

Moves the mouse cursor to a place or element.

move + cursor + target

1
When I move the cursor to {Foo}
2
and I move the cursor to <#bar>
Copied!

move + cursor + target + number + number

1
When I move the cursor to {Foo} at 100, 200
Copied!

open

Opens the device's notifications panel.

open + notificationsPanel

The next sentence is for mobile only:
1
When I open the notifications panel
Copied!

press

Presses a key or key combination, separated by comma.

press + value

1
When I press "Enter"
2
and I press "Control", "Alt", "Delete"
3
and I press "Control", "S"
Copied!
Some special keys (case sensitive!):
  • Add
  • Alt
  • ArrowDown or Down arrow
  • ArrowLeft or Left arrow
  • ArrowRight or Right arrow
  • ArrowUp or Up arrow
  • Backspace
  • Command
  • Control
  • Del
  • Divide
  • End
  • Enter
  • Equals
  • Escape
  • F1 to F12
  • Home
  • Insert
  • Meta
  • Multiply
  • Numpad 0 to Numpad 9
  • Pause
  • Pagedown or PageDown
  • Pageup or PageUp
  • Semicolon
  • Shift
  • Space
  • Subtract
  • Tab

pull

Extracts a device's resource from a path.

pull + value + value

The next sentence is for mobile only:
1
When I pull "/storage/emulated/0/DCIM/logo.png" to "some/path"
Copied!

refresh

Refreshes the current page.

refresh + page or currentPage or url

1
When I refresh the page
2
and I refresh the current page
3
and I reload the page
4
and I reload the current page
Copied!

remove

Removes an app by its internal name.

remove + app + value

Same as uninstall
The next sentence is for mobile only:
1
When I remove the app "com.example.android.myapp"
Copied!

resize

Resizes a window.

resize + window + value + value

1
When I resize the window to 600, 400
Copied!

rightClick

Performs a right click on something.

rightClick + target

1
When I right click {Foo}
2
and I right click <#bar>
Copied!

rightClick + value

1
When I right click "Foo"
Copied!

run

Runs a console command or a database script (SQL command).

run + command

Run a command in the console/terminal.
👉 Commands should be declared between single quotes (') and must stay in a single line
The next sentence is for Test Events only:
1
When I run the command 'rmdir foo'
2
and I run the command './script.sh'
Copied!

run + script

Runs a database script (SQL command).
The next sentence is for Test Events only:
1
When I run the script 'INSERT INTO [MyDB].product ( name, price ) VALUES ( "Soda", 1.50 )'
2
and I run the script 'INSERT INTO [MyDB].Users( UserName, UserSex, UserAge ) VALUES ( "Newton", "Male", 25 )'
3
and I run the script 'INSERT INTO [MyDB].`my long table name`( 'long column`, `another long column`) VALUES ("Foo", 10)'
Copied!
1
When I run the script 'UPDATE [MyDB].Users SET UserAge=26, UserStatus="online" WHERE UserName="Newton"'
2
and I run the script 'UPDATE [MyDB].`my long table name` SET `long column` = "Bar" WHERE `another long column` = 70'
Copied!
1
When I run the script 'DELETE FROM [MyDB].Users WHERE UserName="Newton"'
2
and I run the script 'DELETE FROM [MyDB].`my long table name` WHERE `another long column` = 70'
Copied!
👉 Scripts should be declared between single quotes (') and must stay in a single line
👉 Always include the reference to the database
👉 SQL commands may depend on the used database
Concordia uses database-js to access databases and files through a SQL-based interface. The supported SQL syntax may vary from one database to another. In case of problems, please see the documentation of the corresponding driver.
MySQL, PostgreSQL, and ADO databases
Normal syntax, like the aforementioned. Access through ADO currently works only on Windows.
JSON and CSV databases
  • INSERT accepts only JSON objects or arrays as values
    • Example:
      1
      When I run the script 'INSERT INTO [MyDB] VALUES { "name": "Mary", "surname": "Jane", "age": 21 }'
      Copied!
Excel and Firebase databases
Syntax similar to JSON and CSV databases. However, it has some limitations, as pointed out in its documentation :
SQL commands are limited to SELECT, UPDATE, INSERT and DELETE. WHERE works well. JOINs are not allowed. GROUP BY is not supported. LIMIT and OFFSET are combined into a single LIMIT syntax: LIMIT [offset,]number
INI databases
  • INSERT
  • DELETE
  • UPDATE
    • Example:
      1
      When I run the script 'UPDATE [MyDB] SET age = 22 WHERE name = "Mary"'
      Copied!
SQLite databases
Currently database-js-sqlite uses sql.js that doesn't persist the changes made to the database.

saveScreenshot

Takes a screenshot an saves into a file.
1
When I save a screenshot to "foo.png"
2
and I take a photo to "bar.png"
Copied!

scrollTo

Scrolls to a certain element.
1
When I scroll to <#foo>
2
and I scroll to {Bar}
Copied!

see

Indicates that something can be seen.

see + value

1
Then I see "Foo Bar"
Copied!

see + not + value

1
Then I do not see "foo"
2
and I don't see "bar"
Copied!

see + app + value + installed

The next sentence is for mobile only:
1
Then I see that the app "com.example.android.myapp" is installed
Copied!

see + app + value + not + installed

The next sentence is for mobile only:
1
Then I see that the app "com.example.android.myapp" is not installed
Copied!

see + currentActivity + value

The next sentence is for mobile only:
1
Then I see that the current activity is ".HomeScreenActivity"
Copied!

see + device + locked

The next sentence is for mobile only:
1
Then I see that the device is locked
Copied!

see + device + unlocked

The next sentence is for mobile only:
1
Then I see that the device is unlocked
Copied!

see + value + inside + target

1
Then I see "hello" in {foo}
2
and I see "world" in <bar>
Copied!

see + value + not + inside + target

1
Then I don't see "hello" in {foo}
2
and I don't see "world" in <bar>
Copied!

see + target + with + value

1
Then I see "hello" in {foo}
2
and I see "world" in <bar>
Copied!

see + not + target + with + value

1
Then I do not see {Foo} with "hello"
2
and I don't see <bar> with "world"
Copied!

see + not + value

1
Then I do not see "Foo Bar"
2
and I don't see "Foo"
Copied!

see + target + checked

1
Then I see {Foo} is checked
2
and I see <#bar> is checked
Copied!

see + not + target + checked

1
Then I do not see {Foo} is checked
2
and I don't see <#bar> is checked
Copied!

see + target + attribute + value

1
Then I see {Foo} with the attribute "maxlength" valued "200"
2
and I see the attribute "type" of <#bar> to be "text"
Copied!

see + target + class + value

Note: only for web-based applications
1
Then I see {Foo} with the class "primary-button"
Copied!

see + target + style + value

Note: only for web-based applications
1
Then I see {Foo} with the style "color: blue"
Copied!
1
Then I see the cookie "foo"
Copied!
1
Then I do not see the cookie "foo"
2
and I don't see the cookie "bar"
Copied!

see + value + inside + title

1
Then I see "foo" in the title
Copied!

see + not + value + inside + title

1
Then I do not see "foo" in the title
2
and I don't see "bar" in the title
Copied!

see + title + with + value

1
Then I see the title with "foo"
Copied!

see + not + title + with + value

1
Then I do not see the title with "foo"
2
and I don't see the title with "bar"
Copied!

see + target

1
Then I see {Foo}
2
and I see <#bar>
Copied!

see + not + target

1
Then I do not see {Foo}
2
and I don't see <#bar>
Copied!

see + orientation + landscape

The next sentence is for mobile only:
1
Then I see that the orientation is landscape
Copied!

see + orientation + portrait

The next sentence is for mobile only:
1
Then I see that the orientation is portrait
Copied!

see + target + enabled

1
Then I see {Foo} is enabled
2
and I see <#bar> is enabled
Copied!

see + not + target + enabled

1
Then I don't see {Foo} that is enabled
2
and I do not see <#bar> that is enabled
Copied!

see + text + value or number

1
Then I see the text "foo"
2
and I see the text 1000
Copied!

see + not + text + value or number

1
Then I don't see the text "foo"
2
and I do not see the text 1000
Copied!

see + url + value

1
Then I see the url "/foo"
Copied!

see + not + url + value

1
Then I do not see the url "/foo"
2
and I don't see the url "/bar"
Copied!

select

Selects a value for an element.

select + value + inside + target

1
When I select "foo" in {Foo}
2
and I select "bar" in <#bar>
Copied!

shake

Shakes the device.

shake + device

The next sentence is for mobile only:
1
When I shake the device
2
and I shake the phone
3
and I shake the tablet
Copied!

swipe

Performs a swipe action.

swipe + value + number + number

The next sentence is for mobile only:
1
When I swipe <#io.selendroid.myapp:id/LinearLayout1> to 100, 200
Copied!

swipe + value + down

The next sentence is for mobile only:
1
When I swipe <#io.selendroid.myapp:id/LinearLayout1> down
Copied!

swipe + value + left

The next sentence is for mobile only:
1
When I swipe <#io.selendroid.myapp:id/LinearLayout1> left
Copied!

swipe + value + right

The next sentence is for mobile only:
1
When I swipe <#io.selendroid.myapp:id/LinearLayout1> right
Copied!

swipe + value + up

The next sentence is for mobile only:
1
When I swipe <#io.selendroid.myapp:id/LinearLayout1> up
Copied!

swipe + from .. to

The next sentence is for mobile only:
1
When I swipe <#foo> to <#bar>
Copied!

switch

Switches an app to native mode or web mode, or switches to a certain tab or iframe.

switch + frame

NOTES:
  1. 1.
    All the commands that follow it will be applied to the selected iframe.
  2. 2.
    To switch back to the application, see switch + currentPage or switch + app.
Switches to the first iframe:
1
When I switch to the iframe
Copied!

switch + frame + ui literal

1
When I switch to the iframe <#frame1>
Copied!

switch + frame + ui element

1
When I switch to the iframe {My Frame}
Copied!

switch + iframe inside iframe

1
When I switch to the iframe {SubFrame 1} inside {Frame 1}
Copied!
1
When I switch to the iframe <#subframe1> inside <#frame1>
Copied!

switch + currentPage

Switches from an iframe back to the application page.
1
When I switch to the page
Copied!

switch + app

Switches from an iframe back to the application page. Same as switch + currentPage.
1
When I switch to the application
Copied!

switch + native

The next sentence is for mobile only:
1
When I switch to native
Copied!

switch + web

The next sentence is for mobile only:
1
When I switch to web
Copied!

switch + tab

1
When I switch to the tab 3
Copied!

switch + next + tab

1
When I switch to the next tab
Copied!

switch + previous + tab

1
When I switch to the previous tab
Copied!

tap

Performs a tap on an element.

tap + target

The next sentence is for mobile only:
1
When I tap <~ok>
2
and I tap {Confirm}
Copied!

uncheck

Unchecks a checkbox.

uncheck + target

1
When I unckeck {Foo}
2
and I uncheck <#bar>
Copied!

uncheck + target + target

Unchecks a checkbox which is inside an element.
1
When I uncheck {Foo} in <#bar>
Copied!

wait

Wait for something.

wait + seconds

Wait the given seconds.
1
When I wait 2 seconds
Copied!

wait + target

Wait for a certain element.
1
When I wait for {Foo}
2
and I wait for <#bar>
Copied!

wait + seconds + target

Wait the given seconds for a certain element.
1
When I wait 3 seconds for {Foo}
2
and I wait 5 seconds for <#bar>
Copied!

wait + target + hide

Waits for an element to hide.
1
When I wait {Foo} to hide
2
and I wait <#bar> to hide
Copied!

wait + seconds + target + hide

Waits the given seconds for an element to hide.
1
When I wait 3 seconds for {Foo} to hide
2
and I wait 5 seconds for <#bar> to hide
Copied!

wait + target + enabled

Waits for an element to become enabled.
1
When I wait {Foo} to be enabled
2
and I wait <#bar> to be enabled
Copied!

wait + seconds + target + enabled

Waits the given seconds for an element to become enabled.
1
When I wait 3 seconds for {Foo} to be enabled
2
and I wait 5 seconds for <#bar> to be enabled
Copied!

wait + target + invisible

Waits for an element to become invisible.
1
When I wait {Foo} is invisible
2
and I wait <#bar> is invisible
Copied!

wait + seconds + target + invisible

Waits the given seconds for an element to become invisible.
1
When I wait 3 seconds {Foo} to be invisible
2
and I wait 5 seconds <#bar> to be invisible
Copied!

wait + target + visible

Waits for an element to become visible.
1
When I wait {Foo} to be visible
2
and I wait <#bar> to be visible
Copied!
Waits the given seconds for an element to become visible.

wait + seconds + target + visible

1
When I wait 3 seconds for {Foo} to be visible
2
and I wait 5 seconds for <#bar> to be visible
Copied!

wait + text + value

Waits for a text.
1
When I wait for the text "Foo"
Copied!

wait + seconds + text + value

Waits the given seconds for a text.
1
When I wait 3 seconds for the text "Foo"
Copied!

wait + url + value

Waits for a url.
1
When I wait for the url "/foo"
Copied!

wait + seconds + url + value

Waits the given seconds for a url.
1
When I wait 3 seconds for the url "/bar"
Copied!

wait + option value + value + target

Waits for a value inside an element.
1
When I wait for the value "foo" in <#bar>
Copied!

wait + seconds + option value + value + target

Waits the given seconds for a value inside an element.
1
When I wait 5 seconds for the value "foo" in <#bar>
Copied!
Last modified 7mo ago