How to select Execution Package at runtime

Created by David Rumley, Modified on Fri, 21 Jun at 12:54 PM by David Rumley

Problem:

I have a suite of tests and I want to control which execution package/router the Suite uses at runtime.  I have 2 Execution packages setup:

  1. Local Embedded Selenium Server
  2. Alchemy Cloud Execution


Sometimes, I want it to run in the cloud, and sometimes, I want it to run on my local Selenium server. How can I do this with a command-line parameter when I execute the suite?


Solution:

You'll need to use 2 command line options (-ir and -iw). The first (-ir) to tell Alchemy which Execution package router to use, and second (-iw) to include just the desired integrations, or specifically, to exclude the Alchemy Cloud Integration.


In Alchemy I have 2 Execution packages:


LOCAL Execution package

LOCAL Router


Alchemy Cloud Execution Package

ACE Router





First, Use -q  command line option to get a listing of all of the query ids.  Take note of the IDs for your router(s).

java -jar Spinners.jar -q

Output:

Spinners (Suite): 9109.508

TEST 1 (Test): 9109.1209

TEST 2 (Test): 9128.157

TEST 3 (Test): 9134.2034

TEST 4 (Test): 9151.147

TEST 5 (Test): 9524.1061

SPIN_ME_RIGHT_ROUND (Function): 9524.1079

LOCAL (Router): 9601.3203

edge (Execution Target): 9601.3204

ACE (Router): 9414.174

chrome (Execution Target): 9414.175

www.globalsqa.com (Site): 9109.518

Consumption Calculator (Page): 9109.521

alchemyhelpcenter.freshdesk.com (Site): 9175.1028

Support : Alchemy Help Center (Page): 9175.1030

HTML Generator (Integration): 9414.176

Alchemy Execution Console (Integration): 9414.173

Embedded Selenium Server (Integration): 9601.3201

Alchemy Cloud Execution (Integration): 9414.171

Alchemy GUI Execution Console (Integration): 9414.172



Then, use -ir and add the id of the router you want to include.  Also use the -iw option including just the integration(s) that you want to associate with the execution. So, if I want to:


Execute locally: (use local router and exclude Alchemy cloud integration)

java -jar Spinners.jar -ir 9601.3203 -iw 9414.176 9414.173 9414.172 9601.3201 


Execute in the Alchemy Cloud:

(use cloud router and exclude Embedded Selenium Server integration) 

java -jar Spinners.jar -ir 9414.174 -iw 9414.176 9414.173 9414.172 9414.171 



Note:  To get help for command line options use the -h option

java -jar Spinners.jar -h


This will list all the available options.  


This table shows the available options, given my installed integrations:


-a,--name <arg>

Override the default name of this test suite

-AEC_c,--AEC_color <arg>  

True if your console supports ANSI colors, false otherwise

-CLD_apiKey <arg>

The name of the API Key used to access the Alchemy Cloud     environment

-CLD_cloudUrl <arg>

The base URL used to access the Alchemy Cloud environment

-CLD_gridInactivityTimeout <arg>

The amount of seconds to wait before shutting down and inactive grid

-CLD_launchUI <arg>

A flag indicating if the Alchemy Cloud dashboard should be opened during execution

-CLD_nodeInactivityStartupDelay <arg>

The amount of seconds to wait before before initiating the inactivity timeout process on a node                                                      

-CLD_nodeInactivityTimeout <arg>

The amount of seconds to wait before shutting down an inactive Node

-CLD_secretKey <arg>  

The SECRET key generated when  creating the API Key

-d,--description <arg>

Override the description of this  test

-e,--environment <arg>

The environment variable set to use during execution

-EMB_host <arg>

Specify the host name to listen on

-EMB_managed <arg>

True to automatically download Selenium drivers, false otherwise

-EMB_port <arg>

Specify the port number to listen on

-f,--failurelevel <arg>

What error level fails a test.
1: Infrastructure,

2: Automation  Failure (default),

3: Application Failure,

4: Unknown Error

-GEC_p,--GEC_port <arg>

The port for the embedded HTTP server to listen on (for GUI Execution Console Integration)

-h,--help

Print this message

-HTM_launchUi <arg>

True to launch the UI after execution, False otherwise

-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 parallel

-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 to run

-u,--user <arg>

Override the name of the executing user


In the table above, option(s) for the Suite's integrations are also included.  You will not have some options if the suite does not have the integrations included when it is compiled.


For example: options that begin:

  • -HTML - only available if the suite contains the HTML Generator 
  • -EMB - only available if the suite contains the Embedded Selenium Server
  • -GEC - only available if the suite contains the Alchemy GUI Execution Console
  • -CLD - only available if the suite contains the Alchemy Cloud Execution







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.