Build parameters for Jenkins

You can define the build parameters when you configure either Freestyle or Pipeline projects. You must map the build parameters with the parameters of Run HCL DevOps Test UI - UI Test. 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 in the corresponding field in the Run HCL DevOps Test UI - UI 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 use a different configuration file. In such a case, you can add a String 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 string parameter as Config_file_name in the Name field. You can also provide a default value to be used in the Default Value field and describe the parameter in the Description field. These fields are optional fields.

When you provide the details of the test run in the Run HCL DevOps Test UI - UI Test step, you can enter the value for the Config File field as ${Config_file_name}.

When you run the Jenkins job, the Config_file_name parameter prompts for you to specify the file name. You can provide the name of the configuration file to be used for the test run. You must then click Build to run the test.