Documentation

Looking for something in particular?

ANT Task Parameters

This page summarizes the various ANT task parameters available in the Build File and the Provar Runner 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.

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 where the Provar installation was unzipped. On Windows, this defaults to C:Program FilesProvar. ​This attribute is not required if a complete Provar installation in the default location or PROVAR_HOME Environment Variable is set

testproject.home: Defines the folder that 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 must be generated before executing Test Cases. Refer to the Provar Compile Task section 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 the Provar Runner Task section below for more information)

Note that taskdef, Compile, and Run tasks differ depending on whether or not ANT Task parameters are running with Provar installed. This is demonstrated in the examples below.

Example build.xml


This is an example of a Build.xml with ANT task parameters.

<project default="runtests" xmlns_provar="antlib:com.provar.testrunner.ant">
                   <property environment="env"/>
                   <property name="provar.home" value="<absolute path>"/>
                   <property name="testproject.home" value="<absolute path>"/>
                   <property name="testproject.results" value="<absolute path>"/> 
        <target name="runtests">
            <provar:compile
                   provarHome="${provar.home}"
                   projectPath="${testproject.home}"
                   />
            <provar:run  
                   provarHome="${provar.home}"
                   projectPath="${testproject.home}"
                   resultsPath="${testproject.results}"
                   testEnvironment="UAT"
                   webBrowserConfiguration="Full Screen"
                   excludeCallableTestCases="False"
                   salesforceMetadataCache="Reuse"
                   projectCachePath="D:/runtime-Test-Provar/.provarCaches"
                   >
                   <pluginProperties plugin="sf" maxMemory="1024"/>
                   <pluginProperties plugin="project" maxMemory="1024"/>
                   <pluginProperties plugin="bundled" maxMemory="1024"/>
                   <emailProperties sendEmail="true" primaryRecipients="name@gmail.com,name2@gmail.com"/>      
                   <fileset dir="${testproject.home}/tests" includes="**/*.*"/>
            </provar:run>
        </target>
</project>

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​:ProgramFilesProvar

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 are 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 complete Provar installation in the default location or 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 ANT task parameters. 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 complete 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 the Logging Levels below for more information
  • Defaults to: WARNING

pluginOutputLevel


  • Required: No
  • Definition: Controls the amount of plug-in output logged to the ANT test log. Refer to the 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 plug-ins. Refer to Plug-in 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 the Email Properties below for more information.

Plug-in Properties


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

An example of how to increase memory for the Salesforce plug-in:

<pluginProperties plugin="sf" maxMemory="512"/>

An example of how to debug the Project plug-in:

<pluginProperties plugin="project" debugPort="0" debugSuspend="false"/>

 

plug-in


  • 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 the plug-in can use in megabytes. It 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.

An example of how to send an email after execution:

<emailProperties sendEmail="true" primaryRecipients="UserEmailID" ccRecipients="" bccRecipients="" emailSubject="Provar test run report" attachExecutionReport="true" attachZip="false"/>

An example of how to send an email to multiple users using a comma-separated list:

<emailProperties sendEmail="true" primaryRecipients="UserEmailID,SecondEmailId" ccRecipients="" bccRecipients="" emailSubject="Provar test run report" attachExecutionReport="true" attachZip="false"/>

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).

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

Review Provar on G2
Documentation library

Trying to raise a case with our support team?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top