Command Line Execution

Created by David Rumley, Modified on Wed, 24 Jul at 2:25 PM by David Rumley

Command Line Execution Options Explained

By Default Alchemy uses the included generation template which is Java / Selenium.  Building an executable in the Alchemy GUI desktop client, which is used to develop the scripts, produces a single java file known as a ".jar" file.  This jar contains the generated selenium code for your entire Suite of tests for which it was generated.  In this context, the jar file that is produced is, a standalone application.  In this article I will discuss how to run the Suite of tests, given this jar.  


TABLE OF CONTENTS


In the examples here, BikeShop.jar is the name of my Alchemy generated jar file.



-h , --help

In order to generate the usage tips for alchemy execution, use the -h or --help option at the end of your command.  


java -jar "c:\\data\BikeShop.jar" --help


OR


java -jar "c:\\data\BikeShop.jar" -h


Result:

usage: java -jar The_Bike_Shop

 -a,--name <arg>                          Override the default name of this test

 -AEC_c,--AEC_color <arg>           True if your console supports ANSI colors, false otherwise

 -d,--description <arg>                Override the description of this test

 -e,--environment <arg>              The environment variable set to use during execution

 -h,--help                                       Print this message

 -HTM_outputFolder <arg>          Specify the output folder.  This folder will be erased before each execution

 -HTM_sourceTemplate <arg>      The template used when generating the page source captures

 -HTM_suiteTemplate <arg>         The template used when generating the suite report

 -HTM_testTemplate <arg>           The template used when generating the test reports

 -ie,--includetargets <arg>           A space separated list of execution target identifiers.  Only the names targets will run

 -ir,--includerouters <arg>           A space separated list of router identifiers.  Only targets belonging to these routers will run

 -it,--includetests <arg>               A space separated list of test identifiers that will be executed

 -iw,--includeintegrations <arg>  A space separated list of integration identifiers to use

 -n,--integration <arg>                A property file defining one or more  external integrations to add to this execution

 -o,--timeout <arg>                     The amount of time (seconds) to wait for a test step to return before failing

 -p,--threadcount <arg>              The maximum amount of threads to run in parellel

 -q,--queryids                                List the ID's of all elements that make up this suite

 -rd,--rundevelopment                 Indicates that tests in the development  state should run

 -rq,--runquarantine                     Indicates that tests in the quarantine state should run

 -t,--tags <arg>                           A space separated list of test tags

 -u,--user <arg>                          Override the name of the executing user


Note: Additional options may be available, based on the integrations that are enabled in the Suite.  For example, since I have the HTML Generator integration enabled in my suite, I have various -HTM_ options available



-a,--name <arg>  AND -d,--description <arg>

This screenshot shows the html execution results report when using the following options:

java -jar "c:\data\BikeShop.jar" -a "The Bike Shop Demo Suite Execution Results" -d "This Suite of tests demonstrates the Alchemy Execution of tests against the Demo Bike Shop Application"


-q , --queryids

You'll notice some of the subsequent option ask for identifiers. Identifiers for targets, routers, test, etc.  In order to find all the identifiers in the suite's jar file.  Execute the following command line option:

java -jar "c:\data\BikeShop.jar" --queryids

The result of the command above will list all the Identifiers that may be used to selectively target certain Execution target browsers, or only run certain tests.  The listing will look something like this...but your identifiers will be different from this example screenshot.  The identifiers are in the format <####.####>



-ie , --includetargets

Using what we learned in the previous step about the --queryids option, now we will construct a targeted execution.  Let's presume that my execution package contains 2 routers.  One of them has just a firefox target, while the other one has a chrome and edge target.  


From the --queryids output (pictured above), I see that my firefox browser target is id: 2550.1542.  So, to accomplish running my tests on just firefox, I could use the following option:


java -jar "c:\data\BikeShop.jar" --includetargets 2550.1542

If I am using the Execution Console Integration, My execution console would produce:


-it , --includetests

Building on the above example, let's say I wanted to eliminate all but 3 of the tests from the execution.  The option "-it", allows execution of a specific named test or tests.  Just include a space-separated list of test identifiers for the test(s) from the suite to be run.  In this example, I only want to run the tests called "Test 1" and "Real Test".  Those test have ids of: 1920.1420, and 1920.1644, respectively.  I got that information from --queryids.  The command to run just those 2 test would look like:

java -jar "c:\data\BikeShop.jar" --includetests 1920.1420 1920.1644 --includetargets 2550.1542




Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article

© Orasi Software, Inc. | All Rights Reserved.