ANT Task Parameters

This page summarizes the various parameters available in the Build File and in the Provar Runner Task and Provar Compile Task. This is intended to help you customize the file to your requirements.

Note that Provar can automatically generate the required Build File. Refer to Generating a Build File for more information.

If you are generating the Build File for use on another machine where Provar is not installed (e.g. a Linux machine), generate the Build File then refer to Running Provar on Linux.

Use the following links to navigate to the relevant section.

Build File Parameters

The main components of the Build File are as follows:
  • xmlns:Provar: Defines the provar:run task (see below)
  • provar.home: Contains the location that the Provar installation was unzipped. On Windows this defaults to C:\Program Files\Provar. ​This attribute is not required if there is a full Provar installation in the default location, or if PROVAR_HOME Environment Variable is set
  • testproject.home: Defines the folder which contains the Test Project’s .testproject file
  • testproject.results: Defines the folder where the Test Run’s results should be written
  • taskdef: Defines the Run-Test-Case and Provar-Compile tasks together with the classpaths
  • provar:compile or Provar-Compile: Compiles the Test Project’s Custom Test APIs, Page Objects and Page Components so that they can be executed. This is necessary since Java .class files are not usually stored in Version Control and need to be generated before Test Cases are executed. Refer to Provar Compile Task below for more information
  • provar:run or Run-Test-Case: The Runner task executes your test cases and produces an execution report in HTML format. (Refer to Provar Runner Task below for more information)

Note that the use of taskdef, Compile and Run tasks differs depending on whether ANT is running with Provar installed or without. This is demonstrated in the examples below.

Example Build.xml

This sample file shows an example Build.xml.

  • x​mlns:provar= ​defines the p​rovar:run ​task
  • p​rovar.home contains the location where the Provar installation was unzipped to. On Windows this defaults to C​:\ProgramFiles\Provar
  • t​estproject.home is the folder that contains the Test Project .​testproject file
  • maxMemory defines the maximum memory that the plug-in can use
  • t​estproject.results is where the test run’s results should be written
  • p​rovar:run runs one or more Test Cases or Test Folders

provarHome is not required if there is a full Provar installation in the default location or if the PROVAR_HOME environment variable is set.

Note that, if Provar is not installed on your machine, you should refer to Running Provar on Linux for the correct configuration of this file.

Provar Compile Task

The Compile task is a wrapper around ANT’s standard javac task and inherits these properties. The Compile task sets the source, destination and classpath properties for you from the supplied provarHome and projectPath values.

The Compile task properties are as follows:

provarHome

  • Required: No
  • Definition: The fully qualified path of your Provar installation directory
  • Defaulted as follows:
    • The PROVAR_HOME Environment Variable, if set
    • Otherwise: C:\Program File\Provar on Windows
    • Otherwise: /Applications/Provar on Mac

Note that you do not need to specify this attribute if you have a full Provar installation in the default location or if the PROVAR_HOME Environment Variable is set.

projectPath

  • Required: Yes
  • Definition: The fully qualified path of the Test Project containing the tests to be run.  This is the folder that contains the .testproject file

Provar Runner Task

The Runner task properties are as follows:

provarHome

  • As above

projectPath

  • As above

resultsPath

  • Required: Yes
  • Definition: The fully qualified path of the folder to which Provar will write the test results

testEnvironment

  • Required: No
    Definition: The name of the Test Environment that the test run should be executed against. Test Environments are defined in Test Settings
    Defaults to: The default test environment.

webBrowser

  • Required: No
  • Definition: The web browser to be used for UI testing. Permissable values are:
    • Chrome
    • Firefox
    • IE
  • Defaults to: The web browser last selected in the Test Project

webBrowserConfiguration

  • Required: No
  • Definition: The web browser window size. Browser configurations are defined in Test Settings
  • Defaults to: The web browser last selected in the Test Project

licensePath

  • Required: No
  • Definition: The fully qualified path to your Provar license file
  • Behavior: If the path points to a file, then that file is used. If the path points to a folder then the first activated license in the folder is used
  • Defaults to: [user_home]\Provar\.license

testOutputLevel

  • Required: No
  • Definition: Controls the amount of test output logged to the ANT test log. Refer to Logging Levels below for more information
  • Defaults to: WARNING

pluginOutputLevel

  • Required: No
  • Definition: Controls the amount of plugin output logged to the ANT test log. Refer to Logging Levels below for more information
  • Defaults to: WARNING

fileSet

  • Required: Yes
  • Definition: One or more ANT fileset elements defining the .testcase files to be run.  You can specify individual Test Case files, folders containing Test Case files or a combination of both. Refer to FileSet for details and examples

excludeCallableTestCases

  • Required: No
  • Definition: Indicates whether callable Test Cases should be omitted from execution (true) or included in execution (false)
  • Defaults to: true

stopTestRunOnError

  • Required: No
  • Definition: Indicates whether the Test Run should abort automatically if any test failure is encountered.
  • Defaults to: false

salesforceMetadataCache

  • Required: No
    Definition: Controls the Salesforce Metadata usage. Options are:

    • Reuse: reuses existing metadata
    • Refresh: downloads only metadata changes
    • Reload: deletes old metadata files and downloads fresh metadata

projectCachePath

  • Required: No
  • Definition: The fully qualified path of the folder that will be used for storing metadata

pluginProperties

  • Required: No
  • Definition: One or more pluginproperties elements defining settings for Provar’s test plugins. Refer to Plugin Properties below for more information

emailProperties

  • Required: No
  • Definition: One or more emailproperties elements defining settings for sending email upon ANT execution completion. Refer to Email Properties below for more information

Plugin Properties

Plugin Properties can be nested inside the Runner task to allow customization of the memory and debugging settings for Provar’s plug-ins.

plugin

  • Required: Yes
  • Options are:
    • project: the Test Project’s custom Test APIs
    • bundled: Provar’s bundled Test APIs (excluding UI APIs) and functions
    • sf: Salesforce Test APIs, UI Test APIs and the Test Project’s Page Objects

maxMemory

  • Required: No
    Definition: The maximum amount of memory that the plug-in can use in megabytes. Must be an integer value. Note that this translates the -Xms property for the Java process (where the unit is always ‘m’)

debugPort

  • Required: No
  • Definition: The port number for attaching a Java debugger to the plug-in’s Java process. If ‘0’ then a free port is automatically allocated and displayed in the ANT output

debugSuspend

  • Required: No
  • Definition: Indicates whether the Java process should wait for the Java debugger to connect at start up. Valid values are ‘true’ and ‘false’.

Email Properties

Email Properties can be nested inside the Runner task and allow the sending of emails after ANT execution is completed.

  • This sample file shows an example to send an email after execution
  • This sample file shows an example to send an email to multiple users using a comma-separated list

sendEmail

  • Required: Yes
  • Definition: Indicates whether an email should be sent after ANT execution

primaryRecipients

  • Required: Yes
  • Definition: The email addresses which should receive the email

ccRecipients

  • Required: No
  • Definition: The email addresses which should be CC’d in the email

bccRecipients

  • Required: No
  • Definition: The email addresses which should be BCC’d in the email

Logging Levels

The Logging Level controls the amount of detail logged to the ANT log file during test execution. It applies to the testOutputLevel and pluginOutputLevel attributes (refer to Provar Runner Task above for more information).

The options are as follows:

  • SEVERE: Only error messages are logged
  • WARNING: Error and warning messages are logged
  • INFO: Error, warning and informational messages are logged
  • FINE: Error, warning, informational and high-level debug messages are logged
  • FINER: Error, warning, informational and all debug messages are logged
  • FINEST: All messages are logged