Executing Scripts Using Jenkins Freestyle Project
This article provides detailed instructions for setting up Jenkins, configuring Java and Maven, creating and running a Jenkins job, and managing projects for executing Selenium scripts. It covers all necessary steps to automate builds and test executions in Jenkins using a Freestyle project.
Prerequisites
- Install Jenkins by following the steps described in Jenkins Installation
- Configure Java and Maven by following the steps described in Configure Java and Maven
- Navigate to the algoQA-generated script folder and open Command Prompt by typing cmd in the folder address bar. Run the 'mvn test' command to execute the scripts, then wait until the 'Build Success' message appears. This indicates that your scripts have been executed successfully.
Delete an Existing Project
In the Dashboard, to delete the existing script, select the scripts generated checkbox.

Select the Script Execution dropdown list to delete the project if there are any projects.

Click Yes to delete the project.
Creating a Job and Running a Build Using a Freestyle Project
Perform the following:
In the Dashboard screen, click Create a Job Plus icon and enter an item name.


Select the Freestyle project option and click OK.

In the Configure tab, select the Advanced Settings dropdown list.

Select Use custom workspace option.

Enter the Directory path.

Click Apply.

Click Save.

Click Configure.

Click the Add build step dropdown list.

Click the Invoke Top-level Maven Targets option.

Select the Maven Version dropdown list.

Enter the goals and click Apply.

Click Save.


Click Build Now.

Select the Project from the Build History.

Click Console Output.

The Console Output contains:
- Build Information: Details about the build number, job name, and build status. For example, success, failure test results.
- Log Messages: Output from build steps, including commands executed, and any log messages from scripts or applications.
- Error Messages: Warnings and error messages if something went wrong during the build or testing process.
- Environment Variables: Information about the environment in which the build is running, such as variable values.
- Plugin Outputs: Messages from any installed plugins that are executing during the build process.