Basic knowledge of selenium automation

Source: Internet
Author: User
Tags continuous integration tools selenium grid

What is automated testing?

Automated testing is divided into: Functional Automation and performance automation

Functional automation is the use of computer coding to replace manual testing, the completion of a number of high-repeatability tests, to liberate the test staff test pressure. At the same time, if the system is not part of the module changes, as long as the part of the code to modify the way to overwrite this part of the modified content, greatly improve the test efficiency. However, the late code maintenance needs a certain cost, if the system is more than the form of the system is more or often modified to use automation, because the maintenance cost is too high, for some relatively mature (change is not very frequent) system and run regression test system is suitable for automated testing.

Performance automation is the use of performance testing tools (commonly used billing software with LoadRunner,QTP, open source Jmeter) to simulate thousands of users sending requests to the system, To achieve peak system performance and bottlenecks, but the focus of performance testing is not on the use of tools, but on the performance analysis of various performance reports produced by the tool. Need to complete a complete performance analysis, you need to know a lot of knowledge (computer composition principle, operating system, database principle, computer network principle, Application Server "tomcat",Web server" Apache "etc.).

Performance testing is used for almost every project, but not all projects are suitable for automated testing, but performance testing requires a stronger base knowledge, which is difficult for halfway decent testing, and has pros and cons for future development.

Why UI automation testing?

We can see that the input-output ratio of each phase of the test is the highest in the unit test, because it tests the source code directly, tests for an if judgment or a for loop, so the yield is the highest, But is unit testing suitable for testers to do? The answer is not necessarily suitable, because for the code is of course the developers themselves are most familiar with their own development of the code, if the tester to test, the tester also need to understand the developer's design ideas, the entire process of code read-through, inefficient, so unit testing in 90% all the above companies have developed themselves to complete.

Integration / interface test the relative profitability is still possible, the main completion of the test for each class, interface , the Add () method in a class , pass in the appropriate parameters, test the correctness of the returned results.

The benefits of UI Automation testing are minimal, so why Test UI Automation, because end-user operations are at the UI level, so a lot of the testing workforce will be focused on The UI layer is tested, and the post-regression test is quite a lot of labor-force repetitive testing, so automated testing is an advantage.

What is selenium?

Selenium is an automated testing tool for Web applications, primarily for UI testing;

It features the following points:

1. Multi-language support:java,python,Ruby,PHP

2. Multi-browser support:IE,Chrome,mozila-firefox

3. Open source, free

4. Multi-platform support:Windows,MAC,Linux

Selenium composition?

Selenium has two versions of selenium1.0 and selenium2.0, and is now widely used 2.0,2.0 Many features are supported.

look at the structure of the selenium1.0:

Selenium IDE is a plugin in Firefox that is used to record the operation of the browser and thus generate a script that is easy for beginners to use. The limitation is that the recorded script cannot be used directly, and there are many areas where the code needs to be modified. The main is to give beginners a UI Automation of a process of understanding, the actual effect is not small.

The Selenium Grid is a tool for auxiliary testing that implements the unified execution of test cases on multiple test machines. (Not available for the time being)

Selenium RC is the core part of selenium that executes the test script and then operates on the browser. RC consists of two components:Client Libraries and Selenium Server;

The test script is saved in the Client Libraries

Selenium Server used in Launcher to start and close the browser , Selenium core is deployed to the Web appafter launching the browser, thecore is actually a js function library,selenium is through these JS functions to the browser operation.

Selenium2.0 = selenium1.0 + webdriver

The difference between 2.0 and 1.0 is that2.0 's selenium uses webdriver to replace the Selenium RC method of implementation;

What is the difference between them:

Selenium RC runs javascript applications in the browser , using the browser's built -in JavaScript Translator to translate and execute The Selenese command (Selenese is a collection of Selenium commands).

2.0 's webdriver directly controls the browser via native browser support or browser extensions. webdriver supports more page operations, and the API is more concise and easy to understand.

Selenium Pre-learning knowledge reserve and Pre-installed tools

What kind of knowledge support is needed to learn selenium?

Front-end Knowledge:

HTML---> specific understanding of the meaning of the various tags of html ;

JavaScript---> understand The basic syntax of JS

XML---> Understanding configuration Files

CSS---> can be understood, the latter using CSS positioning may be used to point

Tool Preparation:

Firebug is a firefox plug-in, it sets html View and edit, javascript console, network condition Monitor, cookie View in one, is the development of javascript , css , html ajax

with the FireBug pairing uses Firepath, when A page element is selected by FireBug's mouse arrow,firepath the input box will give XPath expression, quickly help us to locate.

JAVA---> choose according to the development language you use

Eclipse---> script markup IDE Tools, now popular is IntelliJ idea

Selenium jar Package ---> recommended version:2.53.0

Ant---> build tools (or use maven)

Jenkins---> continuous integration Tools

The last two tools are typically used in agile development projects that require continuous integration of automated tests that are temporarily unavailable.

Basic knowledge of selenium automation

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.