自动化测试简介

Testing is a major part of any application development life cycle. There are different types of testing based on the application stage – Unit testing, integration testing, system testing etc. Then there are different types of testing process – Manual testing and Automation Testing.

测试是任何应用程序开发生命周期的重要组成部分。 根据应用程序阶段有不同类型的测试-单元测试,集成测试,系统测试等。然后有不同类型的测试过程-手动测试和自动化测试。

手动测试与自动化测试 (Manual Testing vs Automation Testing)

As the name suggests, manual testing requires human effort in running test cases without the use of any tools. Whereas, automation testing is performed by using some tools and test scripts.

顾名思义,手动测试需要人工来运行测试用例,而无需使用任何工具。 而自动化测试是通过使用一些工具和测试脚本来执行的。

什么是自动化测试? (What is Automation Testing?)

When testing tools like Selenium, QTP, Load Runner etc. are used to write and execute test cases, it’s called Automation Testing.

当使用诸如Selenium,QTP,Load Runner等测试工具来编写和执行测试用例时,称为自动化测试。

什么是功能自动化测试? (What is Functional Automation Testing?)

Functional Automation Testing is the process of identifying various functionalities in the project which need to be repetitively tested and then developing and executing Automation Scripts (Programs) to validate the functionalities.

功能自动化测试是确定项目中需要重复测试的各种功能,然后开发和执行自动化脚本(程序)以验证功能的过程。

自动化测试的优势 (Advantages of Automation Testing)

  1. Automation vastly increases the test coverage

    自动化极大地增加了测试范围
  2. Automation optimize the testing speed

    自动化优化测试速度
  3. Automation improves the testing quality

    自动化提高了测试质量
  4. Automation reduces the cost of testing

    自动化降低了测试成本
  5. Automation reduces the test execution time

    自动化减少了测试执行时间
  6. Automation does not require Human intervention. We can schedule tests to run overnight without human intervention.

    自动化不需要人工干预。 我们可以安排测试在无需人工干预的情况下进行过夜。
  7. Automation scripts can run at any time and any number of times.

    自动化脚本可以随时随地运行。
  8. Reusability of scripts on other applications.

    脚本在其他应用程序上的可重用性。
  9. Easy to test Stress, Performance and Load

    易于测试压力,性能和负载
  10. Saves manual efforts.

    节省了人工。

自动化测试的缺点 (Disadvantages of Automation Testing)

  1. Debugging the test script is a major issue. It may lead to consequences if any error is present in the test script

    调试测试脚本是一个主要问题。 如果测试脚本中存在任何错误,可能会导致后果
  2. Proficiency is required to write automation test scripts

    熟练编写自动化测试脚本
  3. Test maintenance is costly

    测试维护成本高昂
  4. Maintenance of test data is difficult.

    测试数据的维护很困难。

哪些测试用例可以自动化? (Which Test Cases can be Automated?)

Test Cases should be automated if the following conditions are met.

如果满足以下条件,则测试用例应自动化。

  1. Tests that are used repeatedly

    重复使用的测试
  2. High-Risk test cases

    高风险测试案例
  3. Tests that tend to cause human error

    容易引起人为错误的测试
  4. Test Cases that are impossible to perform manually

    无法手动执行的测试用例
  5. Tests that take lot of time to do manual testing

    需要大量时间进行手动测试的测试
  6. Time consuming test scenarios

    耗时的测试方案
  7. Regression test suites

    回归测试套件
  8. GUI items

    GUI项目
  9. Database connections.

    数据库连接。

哪些测试用例不应该自动化? (Which Test Cases should Not be Automated?)

  1. Test Cases for which requires frequent changes

    需要经常更改的测试用例
  2. Test Cases related to UI

    与UI相关的测试用例
  3. Exploratory tests

    探索性测试

何时自动化? (When to Automate?)

  1. When projects are large and critical

    当项目很大且至关重要时
  2. Once application becomes stable

    一旦应用稳定
  3. When enough time is available for testing

    有足够的时间进行测试时
  4. When frequent regression testing needed

    需要频繁进行回归测试时
  5. When manual works are high.

    当手工工作很高时。

什么时候不自动化? (When not to Automate?)

  1. When application not even tested manually atleast once

    如果甚至没有手动测试过一次应用程序
  2. When requirements changing frequently

    当需求经常变化时
  3. When there is no much regression

    当没有太多回归
  4. When there is no time and resource constraint.

    没有时间和资源的限制。

Note: Automation Testing is additional support to speed up the testing activity but not for replacement of Manual Testing because everything cannot be automated.

注意 :自动化测试是额外的支持,可以加快测试活动,但不能替代手动测试,因为所有内容都无法实现自动化。

如何决定要自动化什么而不要自动化 (How to decide what to Automate and what not to Automate)

FeatureProgrammableTesting FrequencyCostAutomation
F1HighHigh
F2LowHigh
F3HighLow
F4LowLow
F5
特征 可编程的 测试频率 成本 自动化
F1
F2
F3
F4
F5

自动化测试工具 (Automation Testing Tools)

  1. Selenium

    Selenium
  2. QTP(UFT)

    QTP(UFT)
  3. RFT

    RFT
  4. Test Partner

    测试伙伴
  5. Silk Test

    真丝测试

QTP, RFT, Silk test are Licensed tools and whereas Selenium is an open source tool.

QTP,RFT,Silk测试是许可工具,而Selenium是开放源代码工具。

自动化测试流程 (Automation Testing Process)

Following steps are followed in an Automation Process:

自动化过程中遵循以下步骤:

  1. Automation Test Planning

    自动化测试计划
  2. Test Environment Setup

    测试环境设置
  3. Analyze test cases

    分析测试用例
  4. Developing test scripts

    开发测试脚本
  5. Enhance test scripts

    增强测试脚本
  6. Scripts debugging

    脚本调试
  7. Scripts execution

    脚本执行
  8. Analyze test results

    分析测试结果
  9. Defect reporting

    缺陷报告
Automation Testing Process

Automation Testing Process

自动化测试流程

自动化测试工具选择标准 (Automation Testing Tool Selection Criteria)

Selecting an automation tool largely depends on application technology. However, some other points to consider while selecting an automation tool are:

选择自动化工具在很大程度上取决于应用技术。 但是,在选择自动化工具时要考虑的其他几点是:

  1. Cost(License Price)

    费用(许可证价格)
  2. Features

    特征
  3. Technology support

    技术支持
  4. Performance

    性能
  5. Maintenance

    保养

规划,设计与开发 (Planning, Design and Development)

During this phase, Tester creates an automation test strategy and plan, with the following details:

在此阶段,Tester会创建自动化测试策略和计划,其中包含以下详细信息:

  1. Automation tool selection

    自动化工具选择
  2. Automation Framework design and its features

    自动化框架设计及其功能
  3. In-Scope features to be tested of automation

    范围内功能需要进行自动化测试
  4. Out-of-Scope features to be tested of automation

    自动化测试之外的功能
  5. Automation testbed preparation

    自动化测试台准备
  6. Schedule and Timeline for scripts generation and execution

    脚本生成和执行的时间表和时间表
  7. Deliverables of Test Automation

    测试自动化的交付物

测试执行 (Test Execution)

In this phase, automation scripts are executed written by testers. To execute the scripts we need input test data before testers run the tests. Once scripts execution completes testers provide detailed test reports.

在此阶段,自动化脚本由测试人员执行。 要执行脚本,我们需要在测试人员运行测试之前输入测试数据。 脚本执行完成后,测试人员将提供详细的测试报告。

保养 (Maintenance)

As new functionalities added each time to the System Under Test with successive cycles, Automation Scripts need to be added, reviewed and maintained for each test cycle release. Maintenance becomes necessary in order to improve the effectiveness of Automation Scripts.

由于每次都有连续的周期向被测系统添加新功能时,需要为每个测试周期版本添加,检查和维护自动化脚本。 为了提高自动化脚本的有效性,必须进行维护。

自动化框架 (Framework for Automation)

A framework is a set of guidelines which helps us in

框架是一组准则,可以帮助我们

  1. Less Maintenance of code

    减少代码维护
  2. Maintaining consistency in overall testing

    保持整体测试的一致性
  3. Improves test structure

    改善测试结构
  4. Minimum code utilization

    最低代码使用率

Types of frameworks used in automation testing:

自动化测试中使用的框架类型:

  1. Keyword Driven Framework

    关键字驱动框架
  2. Data Driven Framework

    数据驱动框架
  3. Modular Framework

    模块化框架
  4. Hybrid Framework

    混合框架

可以自动化的测试类型 (Types of testing that can be automated)

  1. Unit Testing

    单元测试
  2. Integration Testing

    整合测试
  3. Functional Testing

    功能测试
  4. Smoke Testing

    烟雾测试
  5. Regression Testing

    回归测试

结论 (Conclusion)

If testing is one time needed then we should go for manual testing. If testing is frequently needed then we should go for automation testing. The right automation tool selection, testing process and right selection of the testing team are the key players for automation testing to be successful.

如果需要一次测试,那么我们应该进行手动测试。 如果经常需要测试,那么我们应该进行自动化测试。 正确的自动化工具选择,测试过程以及测试团队的正确选择是自动化测试成功的关键因素。

翻译自: https://www.journaldev.com/25157/automation-testing

  • 1
    点赞
  • 31
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Appium是一种用于自动化测试的工具,可以实现自动安装和操作应用程序。它能够动识别某个目录下是否有应用程序,并自动安装。通过写代码在客户端发起请求,请求会传递到Appium服务器端,服务器会生成一个bootstrap.jar包,并将其传输到手机中。然后通过bootstrip去转发、分析指令,调用uiautomator底层框架,并传入要调用的控件的ID、属性、方法等。uiautomator自身具备一些自动化的功能,从而实现对整个应用程序的操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [appiumUI自动化测试入门(appium+pytest+flask+jenkins)持续自动化测试](https://blog.csdn.net/sinat_30329151/article/details/124899851)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [Appium APP UI自动化测试简介与环境搭建](https://blog.csdn.net/weixin_45294964/article/details/111698561)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值