Automated testing overview / automation tools

automated test

◆ Automated testing is the process of transforming manual testing into testing products with machines, software, and programs.
Insert picture description here
Many times the use cases for automated testing come from functional testing as part of functional testing, and more often from smoke testing, generating test scripts from smoke testing.

Automated testing uses code instead of some manual work.

The significance of automated testing
1. Shorten the software development and testing cycle, so that products can be put on the market faster. High test efficiency, make full use of hardware resources. (The significance of automated testing in agile is extraordinary. He can complete software testing faster. He can perform automated regression at night to complete the test.)
2. Save human resources and reduce testing costs.
3. Enhance the stability and reliability of the test. (May be due to people's slackness or inattention, the test is not stable and reliable)
4. Improve the accuracy and precision of software testing and increase software trust.
5. Software testing tools make testing relatively easy, but can produce higher quality test results.

Analysis of application scenarios for automated testing
◆ The first thing to consider is what kind of project is suitable for automation?
◆ Determine whether the project uses automated testing, usually pay attention to the following aspects:

1. The 需求变更有计划性,并且频率不高。
requirements cannot be changed too much, otherwise there is no time to maintain automated testing
2. For 项目周期长, 资源丰富。
example, Alipay has complicated functions and is suitable for automation, but if this project only lasts a few days, there is no need to automate
3. 脚本重复利用率。
4.代码规范。

◆ Considering what kind of project can use automation, the next thing we need to understand is that in a project, we also need to distinguish which parts are suitable for automation
◆ A common view:
that automated testing is more suitable for regression testing and API (interface ) Test, manual test is more suitable for acceptance test and GUI test. ( 大多数人认为带页面的用手工,带接口的用自动化,但是这个观点是不对的)

◆ Correct view:
What distinguishes manual testing and automated testing is actually not related to API or GUI, regression or function.应该从代码是业务逻辑相关还是基础性代码出发

业务逻辑代码对应终端用户使用的那些功能, the work is actually completed.

◆ The basic code确保业务逻辑代码运行在合适的环境中起支撑作用而彼此之间相对独立,并不存在业务关系的

Both of the above codes should be tested, but手工测试更适合测业务逻辑,因为这部分人来学习起来要比交给自动化容易。

Reason: The
basic code may be more efficient with automated testing, such as buying and buying through Yu'ebao, and relying on the docking with the bank and us to know whether the bill has arrived, like this business logic that is biased towards reconciliation , More suitable for manual testing.

Scene analysis:

When doing the test. It is found that the project has a long business cycle, and it can be huge. You can introduce automated testing and then look at the structure of the project. Some functional basic things such as logging in and placing an order can be handed over to automation, and the rest of the complex business logic is manually tested

Common WEB automated testing tools:

Insert picture description here
Mainstream automated testing tool-QTP
◆ QTP is a regression automated testing tool that focuses on functions ; many plug-ins are provided.
◆ The scripting language supported by QTP is VBScript, which is much more comfortable for testers. After all, VBScript is a loose, non-strict, and widely popular language.

◆ High availability of QTP:
1. Support recording and playback
2. Support lower level mode (support click, pixel click)
3. QTP editor supports two views: Keyword mode and Expert mode (have its own separate editor , Mostly used keyword mode)

QTP supports C / S and B / S, and the statement is relatively simple

Script recording process:
Insert picture description hereInsert picture description hereInsert picture description here

Insert picture description here

Selenium(WebDriver)
Compare with QTP to understand the characteristics and advantages and disadvantages of the two.

Price:
Selenium is an open source automated testing tool, but QTP is a commercial version and it is expensive.

Application areas:
Selenium only supports web page testing, while QTP not only supports web interface testing, but also supports client-side testing.

Function: The
recording function QTP supports well. The success rate of QTP recording and playback is very high, and the success rate of selenium is very low.

Script editing function: People who are
familiar with java, python, etc. like selenium, and familiar with VBScript may like QTP.

Framework processing capability:
QTP support is very flexible in terms of data driving. The
data-driven automation script selenium can be completed through simple settings . (Se can build this framework better by programming by himself)

Common automated testing tools-UFT (nothing new)
◆ UFT (Unified Functional Testing)
◆ What is UFT?
◆ UFT is the new name of QTP and is called Unified Functional Testing Framework. The new features are as follows:

  1. Insight intelligent image recognition
    Image recognition has always been one of the obstacles to our automated testing. Contains some automation of game automation, flash dynamics.
    (Only to find some elements based on the image and then to operate)
    2. Multi-script debugging
  2. PDF text verification points
    Now UFT can recognize PDF files and compare them directly, and even insert text verification points. (Comparative tasteless)
    4. Support open source CI
    5. Support mobile devices (but mobile automation testing has its own tools)

Common automated testing tools-RFT
RFT (IBM Rational Functional Tester)
IBM is an automated testing tool suitable for functional testing and regression testing . Object-oriented technology for Java, .NET and recording and playback based on Web applications.
◆ Because the recording and playback functions are too dependent on the environment in which the program runs.
◆ Therefore, more test teams using the tool have adopted their own manual scripting method to improve the script's readability and maintainability

Framework structure: has its own layered architecture
1. RFT scripts can be categorized into AppObjects, Tasks and Testcases
2. AppObjects: Define the elements on the page.
3. Tasks: Define tasks that can be unitized and reusable, and call the elements defined in AppObjects.
4. Testcases: A case is written as a script, and each test scenario can be written as one or more scripts. Each script only calls the reusable tasks defined in Tasks.

RFT structure operation diagram:
Insert picture description here
Why is the scope of RFT dissemination and use not so large?
1. There are few help documents and tutorials, and it is not systematic. The API interface provided is only a description document, not how to use the document; few examples are provided.
2. The environmental requirements are relatively high, at least 1 G memory is required for smooth use, and the card is slower when 512M memory is used.
3. Parameterization only supports the use of Xm | format files to store test data.
4. The playback speed is extremely slow.

Common automated testing tools-WINRUNNER
The older generation of automated test frameworks is an automated test mode that can record-replay-modify-modify earlier. Similar to QTP, it also uses the resource library to store controls. Before 2006, it was the most widely used automated testing tool in the testing industry.
In 2006 Mercury was acquired by ** HP, and now Winrunner has disappeared from the HP product family. ** In addition to the reasons for HP's own implementation of QTP, the mode that only supports C language has not only achieved its prevalence at the time, but also hindered its own scalability .

A new type of automated testing tool: Sikuli
Test tool based on image recognition
◆ Innovative graphical programming technology
Sikuli is a new graphical programming technology released by the research team of MIT (MIT). It is based on image retrieval technology and provides a set of scripting language and integrated development environment based on Jython (a complete implementation of python language in java, which supports some Java code like python). (Whether it is b / s, c / s, I support image-based)
users can use the screenshot to directly bow | program with GUI elements to complete the interactive operation.

◆ Sikuli Script
Sikuli's script writing follows the Python grammar specification, which itself provides a variety of custom classes and methods.
Sikuli is based on Jython and its core code is written in Java.
◆ A simple example of automatically opening the Firefox browser and logging in to Gmail to quickly see the uniqueness of the Sikuli script

The script contains images:
I took a screenshot on my machine, which may not be the same as someone else ’s machine
Insert picture description here

Automated testing tool selection requirements

◆ Open source free
◆ Flexible and simple to use
◆ Easy to maintain in later use cases
◆ Support multiple languages
◆ Easy to integrate with unit testing framework
◆ Can support multiple browsers at the same time, support remote startup of other servers Highly reusable
◆ Code can be controlled independently, for building Frameworks, platforms, etc. have irreplaceable advantages

Published 82 original articles · praised 7 · visits 4166

Guess you like

Origin blog.csdn.net/sunshine612/article/details/105452801