Skip to main content

Almond Automation Commands

This page describe all the commands available in Almond Automation and how to use it.

All commands have following parts
  1. Name: Name of the command like open, click, type, verifyTextPresent.
  2. Element: This is selector on html page. For detailed information please see Almond Automation Selector
  3. Value: The value of command. It depends on selected command. For open command it contains url to open, for type it contains text to be typed etc. Please see individual command description for more details
  4. Params: This is the additional information provided to command.
Element, Value and Params can also contain macros. Macros will be substituted at runtime if any matching value found.

open 

This command open webpage url.
  • name : open
  • element : not applicable
  • value : url of page to open e.g. http://localhost:8080/yourapp.
    This can also contain macros e.g. ${baseurl}. You can specify this parameter while creating environment and value of baseurl will be substituted at runtime.
  • params : not applicable

type 

This command type text into textbox or textarea.
  • name : type
  • element : selector of textbox or textarea e.g. id=username.
  • value : text which needs to be typed into textbox e.g. yourname
  • params : not applicable

select 

This command select element of selectbox. You can select element either by index position, value or visible text of selectbox.
  • name : select
  • element : selector of selectbox e.g. name=type, type is name of selectbox.
  • value : You can specify item to be selected in following format
    <<TBD>>
  • params : not applicable

click

This command click on element.
  • name : click
  • element : selector of element(button etc.) e.g. name=submit
  • value : not applicable
  • params : not applicable

store 

This command generate and store value into variable so that you can use this for verification. E.g. you can use TimeStamp macros to generate new text. You can then use value of variable to verify in later step. You can use value stored in this step to type into textbox or select element from selectbox.
E.g. You want to verify creation of User entity. Username is unique in database. We cannot hardcode value of username because we cannot run this testcase again in same environment. You can use store command to generate new value and save it in variable. On verification process you can then use value of this variable to verify if user is successfully created.
  • name : store
  • element : name of variable e.g. username. You can then use value of this variable like ${username}
  • value : value which needs to be stored in variable. You can use pre defined macros or value of another macros. If you use pre defined macros like ${TIMESTAMP} then its value will be in format yyyy-MM-dd_HH_mm_ss_SSS(2017-11-11_01_01_01_123).
  • params : not applicable

typeAndStore

This command combine type and store command in single command.
  • name : typeAndStore
  • element : selector of textbox or textarea e.g. id=username.
  • value : text which needs to be typed into textbox e.g. yourname
  • params : name of the variable(TBD)

wait 

This command pause execution of testcase by given seconds. This is helpful when next step require element which is not yet present. There are better way to wait(see waitFor command below).
  • name : wait
  • element : not applicable.
  • value : number of seconds to wait e.g. 10
  • params : not required

waitForElementPresent 

This command wait for given element until given element is present on html page. This command is better than providing explicit wait time in wait command.  This command will check every 200ms to verify existence of element with timeout of 5 mins. 
  • name : waitForElementPresent
  • element : selector of textbox, div, button.
  • value : not applicable.
  • params : not applicable(in future user can provide timeout interval).

waitForElementNotVisible

This command check every 200ms to verify if given element is not visible on page.
  • name : waitForElementNotVisible
  • element : selector of textbox or textarea e.g. id=username.
  • value : not applicable.
  • params : not applicable(in future user can provide timeout interval).

waitForElementAndClick 

This command combine waitForElementPresent and Click command.
This command check every 200ms to check presence of element and when element becomes available then click on element.
  • name : waitForElementAndClick
  • element : selector of textbox or textarea e.g. id=username.
  • value : not applicable
  • params : not required

verifyTextPresent 

This command type any text into textbox or textarea.
  • name : tyoe
  • element : selector of textbox or textarea e.g. id=username.
  • value : text which needs to be typed into textbox e.g. yourname
  • params : not required

verifyElementPresent 

This command verify existence of element in current page.
  • name : verifyElementPresent
  • element : selector of textbox or textarea e.g. id=username.
  • value : not applicable
  • params : not applicable

verifyElementNotPresent 

This command verify that element is not present in current page.
  • name : verifyElementNotPresent
  • element : selector of textbox or textarea e.g. id=username.
  • value : not applicable
  • params : not applicable

untilVerifyTextPresent 

This command check every 200ms existence of text in given element specified in element.
This command will fail if text is not present in given element in 5 mins.
  • name : untilVerifyTextPresent
  • element : selector of span, div e.g. id=div_success.
  • value : text which needs to be verified e.g. Successfully created User
  • params : not required

mouseOver 

This command perform mouse over action to given element.
  • name : mouseOver
  • element : selector of element e.g. id=span_user.
  • value : not applicable
  • params : not applicable

dragAndDrop 

This command perform drag and drop operation. It drag element specified in element and drop to location specified in value
  • name : dragAndDrop
  • element : selector of source element or location
  • value : selector of destination element or location
  • params : not required

dragAndDropByOffset 

This command perform drag and drop operation on element and move its position relatively with current position. E.g. If you want to move element 10 pixel right and 20 pixels below with current position then you can x=10;y=20 in value.
  • name : dragAndDropByOffset
  • element : selector of textbox or textarea etc. e.g. id=username.
  • value : new position of element relative to current position e.g. x=10;y=20
  • params : not required

untilVerifyTextPresent 

This command type any text into textbox or textarea.
  • name : tyoe
  • element : selector of textbox or textarea e.g. id=username.
  • value : text which needs to be typed into textbox e.g. yourname
  • params : not required

javascript 

This command execute javascript code in current window. Sometimes in complex scenario when it is not possible to perform desired operation with available commands you can use javascript command to execute any javascript code.
  • name : javascript
  • element : not applicable
  • value : javascript code which needs to be executed.
  • params : not applicable

include 

This command is very important to create modular testcases. You can include command testcases and then include those testcases in other testcases. All steps from include testcase will be executed in same window. Eg. You can create testcase as login then use this testcase in other testcase.
Please check Almond Automation Best Practices & Guidelines for best practices.
  • name : include
  • element : not applicable
  • value : testcase which you want to include
  • params : any params which you want to pass to includable testcase. e.g. username=abc;password=welcome

invoke 

This command will invoke another testcase in new window. You can see new invoke testcase as separate testcase in status screen. E.g. You have user entity and there are many operations which user can perform like create schedule/update settings etc. For verification of every user action you need to create separate testcase. Every testcase is independent so every testcase requires one user. To handle this scenario you can create one testcase create user and invoke other testcase by passing username as variable.
  • name : invoke
  • element : not applicable
  • value : testcase which needs to be invoked
  • params : any params which you want to send new testcase e.g. advertisername=abc

Comments