Construction of Selenium+jenkins Web page Automation test

Source: Internet
Author: User
Tags java web

Jenkins+selenium can achieve continuous integration of web automation.

The basic operation of Jenkins:

First, new view and job

New View:

New job:

You can choose to build a free-style software project or copy an existing item

Ii. Preparatory work:

Install Jenkins plugin, SSH plugin, Email Extension plugin, Hudson SELENIUMHQ plugin

Click System Management, manage plugins

Enter the plugin name in the optional Plugins panel filter, tick the checkbox, click Install directly, restart Jenkins after installation is complete.

Third, after the restart operation:

1. Establish a connection between jobs

A new post-build Actions can be added to configure the next job to be built

Trigger only if build is stable: The next job only executes if the build succeeds

Trigger even if the build is unstable: if this build is unstable you can perform the next job, but failure stops building

Trigger even if the build fails: even if this build fails, you can perform the next job

2. Configure Automation time

Add an auto-execute schedule to the job created in the previous step

Open the Job configuration

Tick build periodically for building triggers

Time Format: * * * * *

*: Minutes hours Sun Moon Week

* indicates that all

MINUTE Minutes within the hour (0–59)

HOUR the HOUR of the day (0–23)

DOM the day of the month (1–31)

Month the month (1–12)

DOW the day of the Week (0–7) where 0 and 7 is Sunday.

* Here's the minute I don't understand why I can't write numbers

PS: Click ". "To view configuration requirements

3. Configure messages for Jenkins

Enter system management, system settings

To configure mail notifications:

* Previous use of "SMTP Authentication", but unable to send mail

Configure the system administrator email address for Jenkins location:

To configure the default message format:

Extended e-Mail Notification

Main changes:

Default Recipients: Receive e-mail address, separated by ","

Default Subject: Message subject

Default content: Defaults message content

To modify the mail delivery configuration in a job

Click Job name, click Configure

* Other can follow the default, the main modification triggers

Add Failure-any, Unstable (Test failures) in Add trigger, send a message when the build fails or is unstable, and will not send any messages if no trigger is added

The above Jenkins configuration is complete.

Then implement the Selenium test case installed on Linux that Jenkins can perform under Windows

A. Windows node that configures Jenkins

1. Click on the left panel:

Management node, System management

2. Click on the left panel: new node

3, enter the node name, select Dumb Slave, click OK

4, enter the relevant configuration, click Save

# of Executors: The number of jobs that can be run concurrently, default is 1

Remote working directory: Working directory for Target Windows

Usage: Select "Allow only jobs bound to this machine to run"

Startup method: Select "Launch slave agents via Java Web start", recommended by Windows machine

* Other Optional or default

5. The following record appears when Save succeeds

6. Configuring Windows Machine

Create the above remote working directory in the target Windows directory: E:\Jenkins

Click on the machine name: Windows_demo, the following page appears:

Download the Slave.jar from the run from slave command line to the remote working directory, and copy the Java command to the TXT file and save it as a bat file.

Double-click the bat file to establish a connection between windows and Jenkins.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.