Build parameters for Jenkins

You can define the build parameters when you configure either Freestyle or Pipeline projects. When you use the build parameters, Jenkins prompts you to enter a value for the defined parameter when you run the Jenkins job. Each parameter has a name and value.

Jenkins supports various types of build parameters. You can choose the type of parameter based on your requirements. Some of the commonly used types of parameters are as follows:

  • Boolean
  • Choice
  • Credentials
  • File
  • String
  • Multi-line String
  • Password

After you add the parameter, the name that you provided for the parameter must be entered for the corresponding fields in the Run HCL OneTest Performance test step in the following format:

${name_of_the_parameter}

For example, ${workspace}

Each time when you run a test from Jenkins, you might want to export the statistical report in a different format. In such a case, you can add a Choice parameter by selecting the This project is parametrized option from the General tab when you configure the project.

You can then provide a name for the Choice parameter as Stat_Report_Format and the available formats of the report as csv, json, simple.csv, full.csv, simple.json, and full.json in the Choices field. You can also describe the parameter in the Description field, which is an optional field.

When you provide the details of the test run in the Run HCL OneTest Performance test step, you can enter the value for the Exported Statistical Report Format field as ${Stat_Report_Format}.

When you run the Jenkins job, the Stat_Report_Format parameter displays to choose the format of the report. You can select the format from the drop-down list. You must then click Build to run the test assets.