HTTP interface automation and continuous integration (Ant+maven+jenkins)

Source: Internet
Author: User
Tags manual prepare port number
1. App performance testing and automated testing 1.1. App Performance Test 1.1.1, client

The main test of the following 8 indicators, can be obtained through the Testin standard compatibility test to obtain these indicators

At the bottom of the terminal List-Details page, you can see the performance metrics on a specific phone.

1.1.2, Server

Test methods and Web server-side testing, most of the interface, some are HTTP interface, some are WebService interface, pressure test for the interface or concurrent testing can use JMeter, LoadRunner and other tools. While some performance testing tools such as the LoadRunner version already support the recording of app-side scripts, it is difficult to actually operate them. 1.2. App Automation Test 1.2.1, UI Automation testing

A UI test is a test app's interaction with a real or simulated user. Ensure that the UI output returned by the application after the user performs a series of gestures (tap, press, swipe, or scroll, etc.) conforms to the product requirements and design drafts, such as keyboard input or UI controls such as toolbars, dialogs, and images, where the most important product operation process meets the requirements. For UI testing, there are typically two choices:

One is to use this app in a real machine or simulator, to walk through all of the app's processes, every page, and try out ways to find out if the app has an unusual performance that doesn't meet the product requirements and design drafts, based on product requirements, design drafts, and test cases.

The second is to use UI Automation test tools, in the framework provided by these tools to write code directly manipulate the UI controls used by the app, simulating user clicks, long presses, swipe or scrolling gestures, before encoding can use the Uiautomatorviewer tool to obtain the properties of the measured parts, common tools Uiautomato, Monkerunner, Robotium, Appium and Monkey (this is strictly not counted). 1.2.2, interface automation

A. Write the interface Automation test program with Java

b, see "HTTP protocol and Interface test"

C, see "The 2nd Chapter after" 1.2.3, Continuous integration

See Chapter 2nd after 2, continuous integration

This is a concept in project management, usually large projects will have a mainline version and many branch versions (can be understood as a project into multiple module groups), each round of product iteration to integrate these branch versions into the main line of the unified release (that is, code). The actual project management, to carry out frequent integration, a few days or once a day (that is, dailybuild), so that you can quickly find the problem early, otherwise the branch version will be significantly off the main line, resulting in the difficulty of integration later, or even difficult to integrate.

Its core approach is that before integration, everyone in the team has to build through Automation (including compilation, release, automated testing), and each branch version must also be built through automation, which cannot be integrated if a test case fails. The mainline version is also dailybuild after integration. This automated build is typically done by a dedicated automated Test team, writing use cases, maintaining the environment, and so on, without too much manual intervention, allowing developers to focus more on their development efforts.

The following is an automated test---HTTP interface for automation testing. The jmeter+ant+ maven+jinkens combination is used. 3. Installation of JKD and JMeter

At the core of the automation framework, each interface test case is still done by JMeter. See "Jmeter" and "Interface Test". These two environments after the installation deployment is complete, you write the interface test script. JMX, ensure manual operation JMeter running these scripts is a use case purpose. 4. Install Ant

Apache-ant is an automated deployment, build, and test tool that can be automated (in DOS, which manually knocks out the ant batch run JMeter script), and can be more intelligent only in the back. The ant directive is equivalent to the Make command under Linux, the default build file is Builid.xml, which is equivalent to the makefile file, and you can use Eclipse to generate templates automatically.

First, unzip and install ant, and configure Ant_home and path, you can use Ant-version to view after completion.

Second, copy the Ant-jmeter-1.1.1.jar in the Extras subdirectory under directory JMeter to the ant installation directory Lib subdirectory.

Third, prepare the test report format file, I prepared two format files here, the file name is different, put in the JMeter Extras directory.

Modify the Jmeter/bin/jmeter.properties file to find the Jmeter.save.saveservice.output_format row, remove the comment and assign the value to XML.

Prepare the Ant script directory:

VI, DOS run: Enter the d:/jmeter_test/directory, the input ant will be run according to Build.xml in bulk running all JMX scripts under script, D:\jmeter_test\result_log\html\ under the test report can be viewed.

Review the test report.

5. Installing maven and Jenkins

Integrating JMeter, Ant, and maven into Jenkins, enabling timed start-up testing, online viewing of test reports, Ant as a software building tool, maven positioning as a software project management tool, and Jenkins as an extensible, continuous integration engine.

First, unzip the installation of MAVEN, and configure Maven_home and path, you can use the maven-version after completion, if you cannot query the appropriate information, you can restart the device.

Second, double-click Jenkins.msi installation, the installation will automatically open after the http://localhost:8080, the first boot as shown below.

Third, how to modify the port number. Jenkins's default port is 8080, but 8080 this port is a secure port, many programs or services need to use this port (port recognition port, registration port and dynamic/private port three categories), to this port conflict, we can only choose to change the port of Jenkins. In the console, execute the command CD <JENKINS_HOME> then Java-jarjenkins.war--httpport=8081. This allows you to temporarily modify the Jenkins port, and if you restart Jenkins you will find that it is starting with 8080 ports. To solve this problem forever, we can use a bat script or a shell script. BAT script for example: Set JENKINS_HOME=C:\JENKINSCD <JENKINS_HOME> then Java-jarjenkins.war--httpport=8081. Each time you run this script to start Jenkins, it's actually the port of Jenkins that is set up once each time.

Iv. how to close and start the Jenkens service. The Jenkins service is self-booting by default. First DOS shuts down or opens the Jenkins service via Netstop/start Jenkins two command. 6. New and running Tasks 6.1. New Task

1. Enter the item name->ok, and go to the Task configuration page

2. Then in the Task Configuration page, continue with the configuration, and finally save.

3. After saving, create to task and go to the status page of the task by default


4. Click "Jenkins" or return to the dashboard to return to the main panel to see the latest build status for all Tasks

6.2. Running Tasks

1, manually built at any time, there are three ways

2, automatic timing construction, equivalent to Linux crontab scheduled tasks

Both of these methods are equivalent to Dos in the ant installation directory to execute the ant command, when completed can view the following information ...


7, late expansion 7.1. Integration Test Report

is to view the ant's HTML test report in the Jenkins service.

First, install the HTML publisher plugins plugin

Second, configure the project "post-build operation"





7.2. Integrated Mail Sending function

By setting the following two items, you can choose under what circumstances Jenkins will send an email to the specified mailbox


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.