Excerpts from "Selenium Python Automation Testing"

I recently learned python automation, and I feel that the book still needs to be read, and the important content still needs to be remembered, otherwise, if you read it again, you will soon forget it, especially the theoretical knowledge.

1. Classification of software testing


Unit testing: testing a single subroutine in a program or a section of code with independent functionality

Integration testing: On the basis of unit testing, a system or subsystem is assembled through unit modules, and then tested, focusing on checking whether the interface between modules is correct

System testing: testing for the entire product system to verify whether the system meets the definition of the requirements specification, and whether the correctness and performance of the software system meet the requirements

Acceptance Testing: The last test operation before deploying the software to ensure that the software is ready to meet all user requirements

White box testing and black box testing are divided according to the degree of visibility of software code in software testing work. Grey box testing is somewhere in between

Black box testing focuses on the external structure of the program and does not consider the internal logic, and mainly tests the software interface and software functions.

White-box test: According to the internal structural test procedure of the program, the test is used to check whether the internal action of the product is carried out normally according to the specification, and whether each channel in the program can work correctly according to the predetermined requirements.

Black box testing method:

  • Equivalence class division method (valid + invalid)
  • Boundary value (exactly equal to, slightly less than, slightly greater than)
  • Error inference (change password happens in multiple places)
  • Cause-and-effect diagrams (what kind of results under what conditions)
  • Orthogonal experimental design method (select appropriate and representative test data from a large number of data)
  • etc

From the different test points of the software, it can be divided into functional testing and performance testing.

Functional testing can be subdivided into: logical functional testing, interface testing, usability testing, installation testing, compatibility testing, etc.

During performance testing, various performance indicators of the system are tested by simulating a variety of normal, peak and abnormal load conditions through automated testing tools

The performance of software mainly includes time performance and space performance.

Time performance: mainly refers to a specific response time of the software. Such as login time, transaction time, etc.

Space performance: mainly refers to the system resources consumed by the software when running, such as hardware resources, cpu, memory, network bandwidth consumption, etc.

From the degree of automation of software testing work, it can be divided into manual testing and automated testing.

Manual testing usually refers to the functional testing we do during the system testing phase

Automated testing is a process of converting human-driven testing into machine execution

Smoke testing, regression testing, and random testing appear in the software functional testing cycle, and are neither specific testing phases nor specific testing methods.

Smoke test: It means to verify whether the basic functions of the software are realized and testable before a large-scale system test of a new version is carried out. Introduction to software testing means that the testing team invests less time and manpower to verify the basic functions of a software before formally testing a new version. If the main functions are not implemented, they will be called back to the development team for redevelopment. The advantage of this is that it can save a lot of time and labor costs.

Regression testing: After modifying the old code, retest it to make sure that the modification did not introduce new bugs or cause errors in other code. is a cyclic process

Random testing: It means that all input data in the test are randomly generated, and its purpose is to simulate the real operation of the user and find some marginal errors. It is generally performed at the end of the test, and the profession is called exploratory testing.

Exploratory testing: It is a testing thinking technique, it does not have many actual testing methods, techniques and tools, but it is a testing thinking technique that all testers should master. Exploratory emphasizes the subjective initiative of testers, abandons the complicated test plan and test case design process, and emphasizes changing the test strategy in time when problems are encountered.

Security testing: In the life cycle of an IT software product, especially the product development is basically completed to the release stage, the product is inspected and the process of verifying that the product conforms to the definition of security requirements and product quality standards.

2. Automated testing

Advocate automated testing in automated testing at different stages of product development


Unit testing: Java's Junit, testNG, C#'s NUnit, Python's unittest, pytest, etc. Almost all mainstream languages ​​will have their corresponding unit testing frameworks

Integration and interface testing: Unit testing focuses on the implementation logic of the code, such as an if branch or a for loop; integration and interface testing focuses on whether the interface provided by a function or class method is reliable.

Automated testing of UI layer: the mainstream are QTP, Robot Framework, watir, Selenium, etc.

The higher the level, the higher the maintenance cost. The specific gravity is generally 70-20-10

3. Automated test conditions

  • The task test is clear and does not change frequently
  • Test verification after daily build (do not understand)
  • more frequent regression tests
  • The software system interface is stable and less changes
  • Identical test cases that need to run on multiple platforms, combined traversal tests, lots of repetitive tasks
  • Long software maintenance cycle
  • Project progress is not too stressful
  • The development of the software system under test is relatively standardized, which can ensure the testability of the system
  • Has a large number of automated test platforms
  • Testers have strong programming skills

Generally, if three or more requirements are met, automated testing can be carried out.

4. Automated testing tools

In a broad sense, all software testing with the help of tools can be automated testing. In a narrow sense, it mainly refers to automated testing based on the UI layer.

QTP: An enterprise-level automatic testing tool that provides powerful and easy-to-use recording and playback functions. Software testing that supports B/S and C/S architectures is the current mainstream automated testing tool.

Note: C/S (Client/Server) client/server, mostly windows platform, B/S (Browser/Server) browser/server, mostly web side

Robot Framework: A functional automation testing framework based on Python, which has good scalability, supports keyword driving, can test multiple types of clients or interfaces at the same time, and can perform distributed test execution

watir: automated functional testing tool based on web mode, Ruby language

Selenium: A tool based on web application testing that supports multi-platform, multi-browse, and multi-language to automate testing.

5. Introduction to Selenium

After all, it is about selenium, so start from here to enter the text

Features:

  • open source, free
  • Multi-browser support: Firefox, Chrome, IE, Opera
  • Multi-platform support: Linux, windows, MAC
  • Multi-language support: java, Python, Ruby, PHP, C#, JavaScript
  • Good support for web pages
  • Simple (simple API), flexible (driven by development language)
  • Support distributed test case execution

Selenium 2.0 = Selenium 1.0 + WebDriver



Supplementary network knowledge:

Network protocols: physical layer, data link layer, network layer, transport layer, session layer, presentation layer, application layer. The first three layers are links, followed by end-to-end

  • Physical layer: The communication is transmitted on the channel as a bit stream
  • Data Link Layer: Frames and Data Frames
  • Network layer: how to choose routes, prevent blocking caused by packets, network knock-up (packet)
  • Transport layer: message
TCP/IP protocol: application layer, transport layer, network layer, physical link layer.

DNS: Map hostnames to network addresses


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325449393&siteId=291194637