Use Jenkins + python + Selenium to build a Web Automation test "framework" (1)-Introduction to each part

Source: Internet
Author: User
Tags python script

Originally built an automated testing framework, vaguely superficial understanding, is to build a only can be used, is not the framework of the thing.

Now look back and see how each step is connected and how it works.

This blog first talk about the parts are what.

Introduction of each part:

  Jenkins:

The mention of Jenkins does not have to be continuous integration. Jenkins is a very well-developed open source software for continuous integration, and Jenkins itself is a Java open source project that offers many feature-rich plugins.

So what's the continuous integration thing? So many professional nouns do not have grounding gas at all. Talk about my vernacular understanding:

First look at the meaning of persistence and integration itself:

        continuous : means to do one thing day after day, year after year.

        Integration : It means getting a bunch of separate things together.

Then come back and look at the continuous integration in Jenkins:

      uninterrupted , automatic, bringing new things together every day. New things include source code, machine environment, test code, and so on. Let the machines do the repetitive, tedious, and regular work.

    Say it for a while, so why use Jenkins? One of the most prominent features of Jenkins is the ability to correlate code repositories (SVN, git, and so on) when the repository changes (someone commits the code to make the code base change). will automatically trigger the build of Jenkins, which will automatically execute the test case. When the test case is all passed, it indicates that the change is not a problem. If the test fails, it indicates a problem after the change, and the reason needs to be identified and resolved before the code can be resubmitted to the repository again.

  Python:

I write test case scripts in Python.

In fact, writing test case scripts can be written in many languages, java,c# compiled language can also. But Python itself is a very flexible scripting language that is quick and easy to write.

Compared with other scripting languages, such as PHP, Ruby, Perl, and so on, Python syntax is concise, the writing format is clear, the data type is easy to use, the class library is rich and covers most areas.

The simplest point: Python is very comfortable to write.

  Selenium

Doing web testing is bound to have to deal with browsers. So how do you automate Web testing and how do you operate your browser? This will require the use of selenium.

What is selenium again? Selenium provides a number of classes, methods, and so on, so that the script can simulate the real user operation browser through the methods it provides.

The selenium has so far gone through two stages, which is also considered to be two versions.

    in the selenium1.0 stage , the selenium is through the JS operation on the page all the action, because it is by invoking JS to operate, so there are a lot of limitations.

For example, unable to make a drag action, the System pop windows can not be manipulated, because JS can only manipulate page elements.

    in the selenium2.0 phase , selenium and Webdriver were integrated together.

With the Webdriver,selenium has been improved from two aspects, on the one hand selenium no longer use JS Operation Browser, but through the different browser vendors provide most of the page operation interface to manipulate page elements.

On the other hand, Webdriver can interact with the system bottom and send the action signal directly. such as what keys to press, where to move the mouse and so on. Visible selenium2.0 is much more powerful than 1.0.

  Here is a brief talk about Webdriver:

Webdriver My understanding:

He's kind of an API, a specification.

A variety of browser vendors refer to this specification to give the selenium the interface to call their own browser.

Then the various programming languages also refer to this specification, giving the language itself, can manipulate different browsers of the class library.

For example, I want to write a test script in Python, to open the Firefox browser through a Python script, to do some column page operation.

This process can be achieved because Python has an external class library called Selenium, and the Selenium class library has different browser packages implemented for different browsers.

This allows me to open the browser, fill out the form, and click the button by importing the Selenium class library and then calling the Firefox package in the Selenium class library.

Well, the first stage is here, and with a little refinement of the "framework", blogs are constantly being updated. Follow up with some pictures to deepen your understanding.

  

Use Jenkins + python + Selenium to build a Web Automation test "framework" (1)-Introduction to each part

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.