Setting Up Jenkins for Automated Testing on Windows
Installing Jenkins on Windows
Initial Setup
Install Jenkins to D:\Jenkins using default settings. After installation completes, access Jenkins at http://localhost:8080.
On the initial setup page, locate the administrator key from the specified file path and paste it into the Administrator password field. Click Continue to proceed.
Select the "Select plugins to install" option to customize the installation.
Required Plugins
Install the following plugins based on your project requirements:
Git Integration
- git plugin: Retrieves source code from repositories
Build Tools
- MSbuild plugin: Compiles Visual Studio solutions
- Ant plugin: Supports Ant-based builds
Agent Communication
- SSH Slave plugin: Connects to agents via SSH protocol
- Windows Slave plugin: Manages Windows-based agent nodes
Job Management
- Copy Artifact plugin: Transfers build artifacts between jobs
- Multijob plugin: Orchestrates multi-phase job pipelines
Utilities
- Workspace Cleanup Plugin: Manages workspace before and after builds
- SSH plugin: Enables remote command execution
- Timestamper: Adds timestamps to console output
- Extended Choice Parameter plugin: Provides enhanced parameter options
Wait for plugin installation to complete. If plugin installation fails, consider upgrading to a newer Jenkins version.
Resolving Login Authentication Issues
If you encounter persistent password errors during setup, modify config.xml in the Jenkins installation directory. Remove the following XML block:
<useSecurity>true</useSecurity>
<authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy">
<denyAnonymousReadAccess>true</denyAnonymousReadAccess>
</authorizationStrategy>
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
<disableSignup>true</disableSignup>
<enableCaptcha>false</enableCaptcha>
</securityRealm>
Restart the Jenkins service from command prompt:
net stop jenkins
net start jenkins
After restart, Jenkins loads directly to the dashboard without requiring authentication.
Configuring Jenkins
Setting Up User Authentication
Navigate to Manage Jenkins → Security → Configure Global Security → Security Realm. Select the appropriate security realm option and save the configuration.
Create dedicated users by accessing Manage Jenkins → Security → Manage Users.
Configuring Credentials
For username/password authentication, access Manage Jenkins → Security → Credentials. Configure authentication settings and save credentials configuration.
Add new credentials through Manage Jenkins → Security → Manage Credentials.
Global Tool Configuration
Configure build tools and runtimes via Manage Jenkins → System Configuration → Global Tool Configuration. Set up JDK installations and version control tools as needed for your projects.
Email Notification Setup
Configure email notifications through Manage Jenkins → System Configuration → Configure System. Set up SMTP settings and notification templates for build status alerts.
Agent Node Configuration
Manage agent nodes via Manage Jenkins → System Configuration → Manage Nodes and Clouds. Click New Node to add additional build agents.
Configure node properties including connection credentials, work directory path, and launch method. Save the configuration to add the node to the Jenkins cluster.
Nodes display with status indicators showing connection state. With correct credentials configured, agents connect automatically to the Jenkins master.
Your Jenkins environment is now ready for creating build jobs. Subsequent steps involve configuring specific project types and automation workflows.