QWords™

In Copado Robotic Testing, test cases are written using simple keywords, "QWords". QWords are keywords which are built-in to Copado Robotic Testing. They enable you to write test cases with high readability, usability, maintainability and robustness.

QWords replicate one user action, like

  • ClickText, clicking a text (button, link etc.) on a screen

  • TypeText, writing to an input field

  • VerifyText, verifying that some text appears on a screen

QWords are platform agnostic keywords, which mean you can use mostly the same QWords to write test cases testing mobiles, browsers or native operating system applications. The easiest way to get familiar with writing tests using QWords is to examine an example test case.

An example test case

Test the global home page
[Documentation]     Accepts the cookie policy, changes the
...        location to 'Global' and verifies home page text.
    [Tags]              Home
    Appstate            home
    ClickText           Accept
    ClickText           Change location
    ClickText           Global
    VerifyText          Robotic software testing. Copado Robotic Testing

Please note that QWords are continuously developed and maintained and hence refer to the latest version of QWords documentation.

Timeouts

Most QWords have an inbuilt timeout. They try to do their action (for example click a button) and re-try if button is not yet visible. QWords keep trying until they can perform the action correctly or until timeout is reached. If timeout is reached, the test case will fail.

The default timeout is 10 seconds. You can change the timeout in two ways:

  • For a specific QWord call with argument timeout

  • Globally for the whole test suite using SetConfig

Example
# the following two lines set the timeout to 2 seconds for this QWord call only
ClickText       Sign in   timeout=2
ClickText       Sign in   2

# the following line changes the timeout for every QWord until the end of test run
SetConfig       DefaultTimeout     60       # sets default timeout to 60 seconds, affecting all keywords

Anchors

Copado Robotic Testing interacts with elements mostly using the UI texts. Sometimes webpage or application contains multiple, duplicated UI texts. While Copado Robotic Testing tries it’s best to click only elements that are actually clickable, you may face situations where there are duplicated elements. By default Copado Robotic Testing clicks the first found element and it can be the "wrong" one. This is where concept of anchors steps in.

In nutshell, anchors are little hints to underlying test execution framework on which of the duplicate elements to select. They work with basically all interaction QWords which uses UI text as a locator (for example ClickText, TypeText etc.)

Anchor types

Anchors can be either text or numbers.

Textual anchors bind text to be found to another text close by. So using for example the following script:

ClickText    Login      anchor=Cancel

…​Copado Robotic Testing tries to find and click text Login which is closest to text Cancel.

Numeric anchors are positional; Copado Robotic Testing finds nth instance of the element on screen. For example, using the following script:

ClickText    Login      anchor=3

…​Copado Robotic Testing would click third instance of element containing text Login.