Framework reference card, v1.39.2

Basic tags

<webelement>

<field>

<button>

<combobox>

<checkbox>

<radio>

Containers

<testcase>

<test>

<import>

<frame>

Work with test data

<variable>

<property>

Special variables

JVM parameters

Work with Rest-services

<rest>

<headers>

<header>

<params>

<param>

<body>

<restassert>

Work with browser

<navigate>

<window>

<script>

<upload>

<dialog>

Pauses and delays

<defaultdelay>

<pause>

Saving test artifacts

<screenshot>

<snapshot>

<video>

Organizing test logic

<before>, <after>

<assert>

<iterate>

<condition>

<failure>

Markers

<bdd>

<echo>

requiredAttributes underlined and have this color

Basic tags

<webelement>

Base element for all actions at web-page

Attributes

One of them required:

id

find dom-element by full “id”

subId

find dom-element by part of id

xpath

find dom-element by xpath

tagName

find dom-element by tag name

cssSelector

find dom-element by css selector

action

sets what tag will do

ref

names tag for reusing in tests

extends

sets parent tag (for inheritance)

text

specifies text for actions isContainsText, isNotContainsText

returnValueName

variable name to save dom-element value

showAlert

we wait for dialog window at next step

expectedDownload

we wait file downloading

showModalDialog

we open modal dialog window and go to it

closeModalDialog

we close current modal dialog and go to previous window

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

smartWaitFor 

we wait for the mandatory element before performing any action on the test page.

It should contain the following parameters:

  • timeout - the maximum time needed to have the element appeared (in milliseconds)
  • step - a wait step  (in milliseconds)
  • id, xpath,cssSelector or tagName - the selector (identifier) of mandatory element, which appears after complete page loading.

Actions

click

click on dom-element

isContainsText, isNotContainsText

checks if dom-element contains text specified in text attribute or not

isExists, isNotExists

checks if dom-element exists on web page or not

isEnabled

checks if dom-element enabled

isDisabled, isNotDisplayed

checks if dom element disabled or not

getText

get dom-element text and put value to returnValueName attribute

mouseMove

move mouse over dom-element

getAttribute, setAttribute

get or set dom-element attribute

download

downloads files by <a href=””> and <img src=””> attributes. File appears in test artifacts folder. Path to file copied to returnValueName attribute

getHtml

returns html-fragment, finded by specified locator, this html saved to variable specified in returnValueName attribute

getSize

get the number of web elements, which were returned by id, xpath, css or tagName selectors, and to place the received amount of web elements in a variable with name specified in returnValueName attribute

openLinkInNewWindow

allows you when clicking on a link to open the page in a new window

Code examples

<webelement subId="logout_link" action="isDisplayed"/>

<webelement action="isExists" xpath="jd406_1:menu_system_logout_link"/>

<webelement action="isEnabled" cssSelector="jd406_1:menu_system_logout_link"/>

<webelement cssSelector="login_button" action="getText"/>

<webelement id="jd406_1:menu_system_logout_link" action="click"/>

<webelement id="loginLink" action="getText" returnValueName="savedPage"/>

<webelement action="download" id="downloadFile" returnValueName="path"/>

<variable ref=”html” value=”nothing” />

<webelement action="getHTML" xpath="//div[1]" returnValueName="html" />

Example on github

<field>

Prints specified text to textfield element. Alias for <webelement>, has all it’s properties and actions + adds new actions. Has action=”type” by default.

Attributes

textToType

text to print into textfield

clearOldText

if true, tag removes old text which was in textfield

Code examples

<field xpath="//form[@id='loginForm']/div /table/tbody/tr[3]/td/table/tbody/tr[1]/td[2]/input" textToType="code"/>

<field id="loginForm" textToType="login" clearOldText="false"/>

Example on github

<button>

Clicks to dom-element. Alias for <webelement>, has all it’s properties and actions. Has action=”click” by default.

Code examples

<button ref="buttonName" id="if90:id_button" />

<button ref="buttonName" subId="_button" />

Examples on github

<combobox>

Used for operations with dropdown elements or comboboxes. Alias for <webelement>, has all it’s properties. Has action=”select” by default.

Attributes

by

text - select combobox element by it’s text content

value - select combobox element by it’s  html “value” attribute

number - select combobox element by it’s number

value

value from combobox to select

Actions

select

make a selection (default)

isContainsText, isNotContainsText

checks if dom-element contains text specified in text attribute or not

Code examples

<combobox id="comboBox" action="isContainsText" text="Blue" />

<combobox id="comboBox" action="select" by="number" value="1" />

<combobox id="comboBox" by="value" value="orange" />

Example on github

<checkbox>

Used for operations with checkboxes elements or comboboxes. Alias for <webelement>, has all it’s properties. Has action=”click” by default.

Actions

click

changes checkbox state by clicking on it

enable, disable

enables/disables checkbox

isEnabled, isDisabled

checks if checkbox is enabled of desibled

Code examples

<сheckbox id="checkboxId1" action="isEnabled"/>

<сheckbox id="checkboxId1"/>

Example on github

<radio>

Used for operations with radiobuttons. Alias for <webelement>, has all it’s properties. Has action=”click” by default.

Attributes

One of them required:

id

id of radiobutton element to select

number

number of radiobutton element to select

text

text, related to radiobutton to select

groupName

“name” attribute of radiobutton to select

Actions

click

changes checkbox state by clicking on it

isChecked

verifies if radiobutton element checked

Code examples

<radio id="someId" />

<radio number="3"/>

<radio text=”Some text" />

<radio id="someId" action=”isChecked” />

Example on github

Containers

Containers allow logically organize tests.

<testcase>

Root tag for tests in XML2Selenium. Contains several <test>, <import>, <before>, <after> tags.

Attributes

name

test case name in reports, can not contain . / \ : * ? “ < > | # characters

description

test case description for reports

tags

labels for filtering test cases in reports, for many tags use comma: tags=”production, shop, booking”

webDriverOn

if false switch off WebDriver, this can be used for tests not related to UI: database, web-services with appropriate plugins

coverageDoc

link to any document (it could be manual test-case or test plan, or some documentation), this link is displayed in reports

smartWaitFor 

we wait for the mandatory element before performing any action on the test page.

It should contain the following parameters:

  • timeout - the maximum time needed to have the element appeared (in milliseconds)
  • step - a wait step  (in milliseconds)
  • id, xpath,cssSelector or tagName - the selector (identifier) of mandatory element, which appears after complete page loading.

Code examples

<testcase  

  xmlns="http://www.jazzteam.org/Routines"  

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-

    instance" xsi:schemaLocation="http://www.jazz

    team.org/Routines http://xml2selenium.com/

    schema/xml2selenium.xsd"

  description="My test    case" tags="base,

  simple">

    <!-- your tests here -->

</testcase>

Example on github

<test>

Specifies single test in a test case.

Attributes

name

test case name in reports, can not contain . / \ : * ? “ < > | # characters

description

test case description for reports

tags

labels for filtering test cases in reports, for many tags use comma: tags=”production, shop, booking”

ignore

if true test execution is skipped

coverage

percent of test coverage for reports (0-100)

expected

expected result of test execution, can be fail, error, success, ignore

where

ref of the tag which caused error if expected=”error” or expected=”fail” used

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

smartWaitFor 

we wait for the mandatory element before performing any action on the test page.

It should contain the following parameters:

  • timeout - the maximum time needed to have the element appeared (in milliseconds)
  • step - a wait step  (in milliseconds)
  • id, xpath,cssSelector or tagName - the selector (identifier) of mandatory element, which appears after complete page loading.

Code examples

<testcase>

  <test name="Test for something"

    tags="booking" description="some test">

    <!-- your test code here -->

  </test>

  <test name="Test for something more"

    tags="booking" description="some test 2">

    <!-- your another test code here -->

  </test>

</testcase>

Example on github

<import>

Imports other xml file content into current file. You can specify common test stems in separate file and import them into your test-cases. <import> must be inside <testcase>.

Attributes

resource

absolute or relative path to imported file

name

namespace for imported file, all test steps and elements from imported file can be accessed only with this namespace

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<testcase>

  <import resource="file.xml" name="fileNS" />

  <test>

      <!-- first test steps -- >

      <!-- using elements from file.xml with “fileNS” namespace -->

  </test>

</testcase>

Example on github

<frame>

Container for any elements and another frames. Frames can contain several tags and used to avoid copy-pasting, like procedures. Frames like other tags support inheritance. Frames are often used with <import>.

Attributes

ref

names frame for reusing in tests

extends

sets parent frame (for inheritance)

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

smartWaitFor 

we wait for the mandatory element before performing any action on the test page.

It should contain the following parameters:

  • timeout - the maximum time needed to have the element appeared (in milliseconds)
  • step - a wait step  (in milliseconds)
  • id, xpath,cssSelector or tagName - the selector (identifier) of mandatory element, which appears after complete page loading.

Code examples

<!-- frame and inheritance example -->

<frame ref="baseLogin">

  <field ref="login" id="loginField"

    textToType="user"></field>

  <field ref="password" id="pwdField"

    textToType="password"></field>

</frame>

<!-- Extending from first frame -->

<frame ref="loginAnotherPassword"

  extends="baseLogin">

  <field ref="password" textToType="123">  

  </field>

</frame>

Example on github

Work with test data

<variable>

Sets variable for using in tests.

Attributes

value

value of the variable

ref

names variable, it is possible to get variable value using this name, you can’t specify both ref and change attributes

extends

sets parent tag (for inheritance)

change

variable ref which we want to change, you can’t specify both ref and change attributes

changeable

specifies if variable value could be changed in test, false by default

global

allows to use the variable globally in the whole testcase, can possess the value true/false. By default this attribute equals false.

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<variable ref="password" value="123" />

<field id="passwordField" textToType="${password}"/>

<!-- Variable value can be changed -->

<variable ref="var1" changeable="true" value="111"/>

<!-- Change value to 555 -->

<variable change="var1" value="555"/>

<assert first="${var1}" second="555" action="equals"/>

Example on github

<property>

Gets constants from *.property text files for using in test.

Attributes

resource

absolute or relative path to *.property file

name

namespace for property file, work with constants from property file is only possible using this namespace

key

key from property file if you want to take only one value

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<property resource="file/path/const.properties"

    name="const" key="key1"/>

<field id="pwInp" textToType="${const.key1}" />

Example on github

Example on github 2

Special variables

You can use this variables in your tests

${xml2selenium.suiteId}

unique id for each test run

${xml2selenium.testCaseName}

full testcase name with folders

${xml2selenium.date}

current date (DD.MM.YYYY)

${xml2selenium.testName}

name of current test

${xml2selenium.timeStamp}

current time in milliseconds

JVM parameters

xml2selenium.browserWidth

(Integer) Determines the browser window width

xml2selenium.browserHeigth

(Integer) Determines the browser window height

xml2selenium.browserProfilePath

(String) Sets the path to the profile folder of used browser was added. The usage of profiles is supported for FireFox browsers

xml2selenium.browserstack.tunnel

(true/false)  Able/disable the using Tunneling function.

xml2selenium.browserstack.debug

(true/false)  Able/disable the maintenance of visual test log.

xml2selenium.browserVersion

(String) Denote the browser version we want to use.

xml2selenium.osName

(String) Denote the operating system we want to use.

xml2selenium.osVersion

(String) Denote the operating system version we want to use.

Work with Rest-services

<rest>

Tag provides the ability to test REST-services.

Attributes

url

url address where this request will be send

method

HTTP method of request, can be: get, post, put, delete

returnValueName

variable name to save resulting response form Rest-service

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Child tags of rest:

<headers>

Container for header tags

<header>

Defines name and value that will be put into header of request

Attributes

name

name of the header

value

value of the header

<params>

Container for param tags

<param>

Defines name and value that will be added as parameters of request

Attributes

name

name of the parameter

value

value of the parameter

<body>

Data that will be send in body of request

Code examples

<rest url="http://localhost:${jetty.port}/test/ rest/todos/1" method="get" returnValueName="restResult" />

<rest url="http://localhost:${jetty.port}/test/ rest/todos/" method="post" returnValueName="restResult">

 <headers>

  <header name="Content-Type" value="application/json"/>

 </headers>

 <body>

  <![CDATA[

        {"id":${id}, "description":"${description}", "summary":"${summary}"}

  ]]>

 </body>

</rest>

<rest url="http://localhost:${jetty.port}/test/ rest/todos/${id}" method="put" returnValueName="restResult">

 <headers>

  <header name="Content-Type" value="application/xml"/>

 </headers>

 <body>

  <![CDATA[

   <todo>

        <id>${id}</id>

        <description>Updated ${description}</description>

        <summary>Updated ${summary}</summary>

   </todo>

  ]]>

 </body>  

</rest>

<rest url="http://localhost:${jetty.port}/test/ rest/todos/${id}" method="delete" returnValueName="restResult"/>

<rest url="http://localhost:${jetty.port}/test/ rest/todos" method="get" returnValueName="restResult">

 <params>

  <param name="id" value="1" />

 </params>

</rest>

<restassert>

Tag provides the ability to make various checks of  REST-service answer: check the response code, response message, check the contents, etc. The values, that were sent to response and value attributes, can be both strings and groovy expression or links to variables in the context.

Attributes

response

name of variable that contains response from server

action

sets what tag will do

value

expected value, uses by following actions: checkType, checkCode, checkStatusMessage, checkCharset,  checkXPathContent, checkJSONPathContent, checkRegExpContent

expr

uses for defining of expression for following actions: checkXPathContent, checkJSONPathContent, checkRegExpContent

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Actions

isNotEmpty

checks that response is not empty

checkType

checks type of response, for example, text/json

checkCode

checks status code of response from service

checkStatusMessage

checks status message of response from service

checkCharset

checks encoding of response

checkXPathContent

gets some value by XPath and checks that it equals to expected value

checkJSONPathContent

gets some value by JSONPath and checks that it equals to expected value

checkRegExpContent

gets some value using regular expression and checks that it equals to expected value

Code examples

<restassert response="restResult" action="checkType" value="text/xml"/>

<restassert response="restResult" action="checkCharset" value="${charsetUtf8}"/>

<restassert response="restResult" action="checkCode" value="200"/>

<restassert response="restResult" action="checkStatusMessage" value="OK"/>

Work with browser

<navigate>

Opens new page in browser with specified url. Supports opening local files using file:///path/to/file. Checks if page is available only for http:// and file:/// protocols.

Attributes

to

url of web-page to open

ref

names tag for reusing in tests

extends

sets parent tag (for inheritance)

expected404page

used for testing 404 error pages, if true, opening such page would not be considered as test fail

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<navigate to="http://xml2selenium.com" />

<navigate to="file:///c:\pages\mypage.html" ref="navigateMyPage" />

Examples on github

<window>

Allows to switch between browser tabs, open, close them and do other things. New tab would be opened in a new browser window.

Attributes

assert

checks new window state, values:

newWindowOpened:background - checks if new window opened in background

newWindowOpened:current - checks if new window is current

action

action to perform with window, see <window> tag actions

ref

names window for later operations

where

name of window which we want to switch

what

names window which must be closed by closeWindow action

currentWindowRef

names current window for later access

newWindowRef

names new window for later access

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Actions

getCurrentWindow

gets current opened window and saves it to ref attribute

getNewWindow

opens new window in a background mode and saves it to ref attribute

getPreviousWindow

get previous window and saves it to ref attribute

goToNewWindow

go to new window, action can be used with newWindowRef and currentWindowRef attributes

goToWindow

goes to window in where attribute, could be used with currentWindowRef attribute

closeWindow

close window in attribute with name what

closeCurrentAndGoToWindow

close current window and go to another which is in a where attribute

Code examples

<window assert="newWindowOpened:background" />

<window action="goToNewWindow"/>

<window assert="newWindowOpened:current" />

<window action="getCurrentWindow" ref="currentWindow"/>

<window action="getNewWindow" ref="newWindow"/>

<window action="getPreviousWindow" ref="previousWindow"/>

<window action="goToNewWindow" newWindowRef="newWindow" currentWindowRef="currentWindow"/>

<window action="goToWindow" where="newWindow" currentWindowRef="previousWindow"/>

<window action="closeWindow" what="prevWin"/>

<window action="closeCurrentAndGoToWindow" where="previousWindow"/>

Example on github

<script>

Used for executing scripting language on a webpage. Must contain child tag with specifying language (See in example below). By now only javascript supported.

Attributes

Optional:

ref

names tag for reusing in tests

extends

sets parent tag (for inheritance)

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<script>

  <javascript>

    document.getElementById('LoginBtn')

       .click();

  </javascript>

</script>

<script>

  <javascript>

    <![CDATA[

      document.open();

      document.write('<input type="submit"’ +

        ‘id="button1" value="Button1"/>');

      document.close();

    ]]>

  </javascript>

</script>

<!-- Carry variable into javascript code -->

<variable name=”buttonId” value=”some text”>

<script>

  <javascript>

    <![CDATA[

      document.getElementById(“${buttonId}”)

        .click();

      // Carry variable from javascript to test

      x2s_context["buttonId"] = “newId”;

    ]]>

  </javascript>

</script>

Example on github

<upload>

Allows to set file to upload when standard html tag <input type=”file”/> is used. <upload> tag allows to skip standard browser file upload select dialog. Has all attributes of <webelement> and action=”upload” by default.

Attributes

resource

path to file for upload, could be relative or absolute

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Actions

upload

fills upload file form (default)

Code examples

<upload ref="upload" id="fileUpload" resource="files/file.txt"/>

Example on github

<dialog>

Works with browser dialogs: alerts, confirms, prompts. Tag allows to get text from dialog, print text to dialog, close dialog. Previous tag which opens dialog must have attribute showAlert=”true”.

Attributes

action

names tag for reusing in tests

returnValueName

sets parent tag (for inheritance)

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<!-- Press button which opens dialog. showAlert=”true” is required →

<button id=”dialog” action=”click” showAlert=”true” />

<!-- Press OK button on dialog -->

<dialog action=”accept”/>

Example on github

Example on github 2

Example on github 3

Pauses and delays

<defaultdelay>

Sets timeout for finding any dom-element by locator (id, subId, ...). If framework doesn’t find element before timeout there would be a test fail. Default timeout is 10 seconds.

Attributes

time

timeout for finding any dom-element in milliseconds

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<!-- change default timeout to 15 seconds -->

<defaultdelay time="15000"/>

Example on github

<pause>

Pauses framework execution on specified time in miliseconds. Pause needed for waiting some special events on webpage.

Attributes

time

timeout to pause in miliseconds

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<!-- pause for 10 seconds -->

<pause time="10000"/>

Example on github

Saving test artifacts

<screenshot>

Makes screenshot of the webpage. Screenshots are saved into test artifacts folder.

Attributes

filePrefix

prefix for screenshot image file

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<!-- make screenshot -->

<screenshot/>

<!-- image file name with prefix-->

<screenshot filePrefix=”myScreenshot”/>

Example on github

<snapshot>

Saves html source (snapshot) of the webpage. Snapshots are saved into test artifacts folder.

Attributes

filePrefix

prefix for snapshot image file

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<!-- make snapshot -->

<snapshot/>

<!-- html file name with prefix-->

<snapshot filePrefix=”myScreenshot”/>

Example on github

<video>

Records tests on video to flv files. It is possible to save several videos for one test. Videos are saved into test artifacts folder.

Attributes

filePrefix

prefix for saved video file

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Actions

start, stop

start or stop video recording

Code examples

<!-- start videorecording -->

<video action="start" />

<!-- your test code here -- >

<!-- stop video recording -- >

<video action="stop" />

Example on github

Organizing test logic

<before>, <after>

Allows to insert parts of code which executed before and after each test. Code in <after> executed even if test was failed. <before> and <after> are used for preconditions like login and logout user.

Attributes

scope

sets if variables in <before> and <after> sections are available in all tests

default - variables available only in <before>, <after>

test - variables available in all tests

smartWaitFor 

we wait for the mandatory element before performing any action on the test page.

It should contain the following parameters:

  • timeout - the maximum time needed to have the element appeared (in milliseconds)
  • step - a wait step  (in milliseconds)
  • id, xpath,cssSelector or tagName - the selector (identifier) of mandatory element, which appears after complete page loading.

Code examples

<before>

  <!--go to website and login-- >

  <navigate to=”http://mysite.com” />

  <frame extends=”login”/>

</before>

<test>

  <!-- first test steps -- >

</test>

<test>

  <!-- second test steps -- >

</test>

<after>

  <!-- logout from website after each test -- >

  <frame extends=”logout” />

</after>

Example on github

<assert>

Compares two values, which could be variables, constants, groovy expressions.

Attributes

first

first attribute value

second

required sometimes, depends on action

second attribute value

result

sets which result we expect

failure - test finished with fail

warning - message goes to log file and do not fail test

error - test finished with error

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Actions

equals, notEquals

checks if values are equals or not equals

moreThan

check that first variable value greater than second

isTrue

check that first attribute value is true

isEmpty

check that first attribute value is empty

variableExists

check that variable, which name specified in first attribute, exists

size

checks number of dom elements founded by xpath or tagname

isContainsText, isNotContainsText

check that first attribute value contains or not contains text specified in second attribute

fileDownload

checks if file downloaded and sets path to this file in variable which name specified in first attribute

Code examples

<variable ref="attributeValue" value="New Value" />

<assert first="attributeValue" action="variableExists" />

<variable ref="x" value="10" />

<variable ref="y" value="2" />

<assert first="${x}" second="${y}" action="moreThan" />

Example on github

<iterate>

Repeats operations, which described in frame.

Attributes

for

list of elements to iterate.

1) IDs of elements

2) result of <webelement> tag with several elements found

var

loop variable name which will contain all values

run

ref of the frame to execute

variableCondition

name of variable for loop interruption, for interrupt loop this variable value must be true

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<webelement subId="d" ref=”elms"/>

<iterate for="elms" var="x" run="frm" />

<frame ref="frm">

    <webelement id="${x}" action="isExists"/>

</frame>

<!-- iterate elements by subid -->

<webelement subId="text" ref="subid_inputs" />

<iterate for="subid_inputs" var="variable" run="frm" />

<!-- iterate elements by css class name -->

<webelement tagName="div" ref="tagNm" />

<iterate for="tagNm" var="z" run="frm" />

<frame ref="breakFrameOnSecondIteration">

<echo message="${Integer.parseInt(count)+1}"/>

<variable change="count" value="${Integer.parseInt(count)+1}"/>

<variable change="condition" value="${Integer.parseInt(count)>1}"/>

</frame>

<iterate for="1,2,3,4,5" variableCondition="condition" var="i" run="breakFrameOnSecondIteration"/>

Example on github

<condition>

Fulfillment or unfulfillment of frame depending on particular conditions.

Attributes

value

expression to determine the conditions, for fulfillment frame this value must be true

run

ref of the frame to execute

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<variable ref="var" changeable="true" value="1"/>

<frame ref="changeVarFromTest">

    <variable change="var" value="2" />

    <echo message="change variable in condition"/>

</frame>                

<assert first="${var}" second="2" action="equals"/>

<variable change="var" value="1"/>

<condition value="${var.equals('1')}" run="changeVarFromTest"/>

<assert first="${var}" second="2" action="equals"/>

<failure>

Manually fails test with concrete result and message.

Attributes

result

test fail result, can be:

failure (by defaule) - test finishes with failure

error - test finishes with error

message

message for test fail

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<test>

  <failure result="error" message=”Not implemented test”/>

</test>

Example on github

Markers

<bdd>

Marks test parts for further displaying in behaviour reports.

Attributes

message

message for report

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<bdd message=”First step” />

Example on github

<echo>

Prints message to log file. Useful for debugging.

Attributes

message

message to print into log file

condition

allows to fulfil or don’t fulfil tag depending on certain conditions, can possess the string value true/false or Groovy-expression that results in  true or false. By default this attribute equals true. 

Code examples

<echo message="my message"/>

Example on github