Learning By Example

Edited on December 14, 2016

For your convenience, we've packaged and populated multiple scripts, keywords and test plans examples for you to learn interactively by executing tests immediately, and using the many different libraries and simulation levels which step offers.

All of the scripts described in this section can be found inside of the folder step-agent-3.2.0/data/scripts .
Keywords and Test Plans are objects which are created and configured through step's web application and are therefore populated automatically upon installation.

Simple Javascript examples

See Scripts Demo_Echo.js and Javascript_HttpGet.js and the corresponding Keyword configuration and Demo Test Plans in the application.

Grinder examples (Jython)

See scripts Grinder_HttpGet.py and Grinder_BingScenario.py, and the corresponding Keyword configuration and Demo Test Plans in the application.

Headless Selenium example (Javascript + HTMLUnit as a driver)

See scripts Selenium_StartHTMLUnit.js and Selenium_Navigate.js, and the corresponding Keyword configuration and Demo Test Plans in the application.

Generic Process example

Just look straight at the Keyword ExcecuteProcess as well as the Demo_Testcase_ProcessExecution_Windows and Demo_Testcase_ProcessExecution_Linux, which are all contained inside of step already.

Browser-based Selenium example (Javascript + Firefox)

Don't forget to copy the binary files prior to executing these examples, as explained in the "Basic Installation" section if the Getting Started page.

See scripts Selenium_StartFirefox.js and Selenium_Navigate.js, and the corresponding Keyword configuration and Demo Test

Pure Java example

See Java .class and .java files contained inside the step-agent-3.2.0/data/scripts/java folder, and inspect the corresponding Keyword and Tesplan called  "Demo_Java_Clock" and "Demo_TestCase_Java_Clock" in step.

We haven't included Groovy JRuby Scala or Clojure examples yet but all of these languages can be used through JSR-223 compliance. Just try it, it works ! :)

ForEach example

See also the test plan "Demo_Testcase_ForEach_CSV" for a very short example of how to use a control block in step (in this case, iterate over a CSV datapool and invoke a Keyword with the CSV line content as its input).