Selenium Java Junit Jenkins automated test related __java

Source: Internet
Author: User
Tags log4j

In recent days contact automation test, to now check not to go a process, check a lot of data, as follows points out a Ming Luha haha

(The first thing to be clear, automated testing is to enable the browser to automatically perform an operation, such as login, and so on, without a person to click)


1, the environment constructs (I see is the blog Park small tank's Bowen, Inside has a complete set of tutorials, relatively good introduction)

Http://www.cnblogs.com/TankXiao/p/4110494.html


2, write Java Script

I used the IDE to record scripts and then export them as junit test cases, and of course, not all of them were right, and they needed to be adjusted.

Similar to the following:

Driver.findelement (By.cssselector ("#sizzle -1495007545683 > Span")). Click ();

So click on the text box and so on other things, in fact, some are not located in the text box, we do not need to click the text box, in the IDE right to delete this or in the export of the code to delete the good


3. Print log file (using the log4j)

Specific Access http://www.cnblogs.com/lizitest/p/5153135.html


4, Generate test report (is using ant inside the test report)

Specific Access http://blog.csdn.net/yaominhua/article/details/6589389


5. Configure Jenkins

Specific Access http://m.blog.csdn.net/article/details?id=53380373


6, configure a good Jenkins after the test report problem

Will find the test report HTML reports clicked in a blank, no content, because Jenkins banned a lot of things, such as CSS JavaScript ...

Specific reference:

Https://wiki.jenkinsci.org/display/JENKINS/Configuring+Content+Security+Policy

Solution:

Jenkins---"System Management---" Script command line input:

System.setproperty ("Hudson.model.DirectoryBrowserSupport.CSP", "")
And then rebuild the project, click again and there's no problem.
Have not passed the file, and later try to upload a use of the jar package and other files, ok so, hope useful
The following gives the jar package download address, Description: Jenkins to the official website, file upload size requirements, I will not upload; then JDK uses 1.7 if not also download
Selenium
http://download.csdn.net/detail/sinat_32668567/9844917
Firefox
http://download.csdn.net/detail/sinat_32668567/9844913
Poi:
http://download.csdn.net/detail/sinat_32668567/9844922
Selenium API:
http://download.csdn.net/detail/sinat_32668567/9844930
log4j:
http://download.csdn.net/detail/sinat_32668567/9844921



Related Article

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.