简体   繁体   English

自动化测试方法-哪个最好?

[英]Automation Testing approach - Which is best?

Which is the best suited automation approach? 哪种方法最适合自动化? is it Data driven testing or Keyword driven testing? 是数据驱动测试还是关键字驱动测试? Now even we have Business process testing, what according to you is best approach? 现在,即使我们已经进行了业务流程测试,根据您的最佳选择是什么?

It all depends on your needs. 这完全取决于您的需求。 As a long-term investment I recommend keyword-driven or hybrid keyword/data driven framework. 作为一项长期投资,我建议使用关键字驱动或混合关键字/数据驱动框架。

See my short overview below (taken from my blog page http://automation-beyond.com/category/automation/automation-methodology/practices/ ). 请参阅下面的简短概述(摘自我的博客页面http://automation-beyond.com/category/automation/automation-methodology/practices/ )。

Front-End Test Automation Practices – Record/Playback 前端测试自动化实践–记录/回放

  1. Description • Hard-coded data • Hard-coded flow • No error handling • No or limited reporting • No structure • No verification • No validation 描述•硬编码数据•硬编码流•无错误处理•无报告或报告有限•没有结构•没有验证•没有验证

  2. Advantages • Easy to create • Quick to create • No programming required 优点•易于创建•快速创建•无需编程

  3. Disadvantages • Very low usability • Extremely high maintenance cost • No-proof test results • Break on any fail • Poor test flow coverage • A lot of manual work is still required 缺点•可用性很低•维护成本极高•测试结果不可靠•失败时无法检查•测试流程覆盖率很差•仍然需要大量的手工工作

  4. Applicability • Demo and sale presentations • Same day testing (re-record from scratch, short test flow) • Exploratory testing (investigating how the Testing Tool handles the Application) • Automated data entry (restrictions apply) 适用性•演示和销售演示•当天测试(从头开始记录,简短的测试流程)•探索性测试(调查测试工具如何处理应用程序)•自动化数据输入(有限制)

Front-End Test Automation Practices – Record/Playback Enhanced 前端测试自动化实践–增强了记录/播放

  1. Description • Parameterized data • Dataset is a part of the script but not in the code • Verification via GUI checkpoints (hard-coded) • Hard-coded flow • No error handling • No or limited reporting • No structure 说明•参数化的数据•数据集是脚本的一部分,但不在代码中•通过GUI检查点进行验证(硬编码)•硬编码流•无错误处理•无报告或报告有限•无结构

  2. Advantages • Easy to create • Quick to create • No programming required, but expertise on the Testing Tool is a must 优点•易于创建•创建快速•无需编程,但必须具备测试工具的专业知识

  3. Disadvantages • Vulnerable scripts • No multi-environment support • Very high maintenance cost for checkpoints • Not reproducible test results • Break on any fail • Limited test flow coverage • All analysis and validation done manually 缺点•易受攻击的脚本•不支持多环境•检查点的维护成本非常高•测试结果无法重现•失败时失败•测试流程覆盖范围有限•所有分析和验证均手动完成

  4. Applicability • Single/stable environment • Short flow Test Cases • Limited set of checkpoints, as any Database / Data Input change breaks verification and requires recapture • Short-term simplified automation goals 适用性•单一/稳定的环境•短流程测试用例•有限的检查点集,因为任何数据库/数据输入更改都会破坏验证并需要重新捕获•短期简化的自动化目标

Front-End Test Automation Practices – Data-Driven Framework 前端测试自动化实践–数据驱动框架

  1. Description • Programmatically created • Parameterized, capable to import spreadsheets • GUI/Database checkpoints, hard-coded and/or parameterized • Library-based structure • Possibly error handling • Hard-coded yet data-driven flow (input and logic) • Standard reporting • Verification is limited to Testing Tool's capabilities • No validation 描述•以编程方式创建•参数化,能够导入电子表格•GUI /数据库检查点,经过硬编码和/或参数化•基于库的结构•可能的错误处理•硬编码但数据驱动的流程(输入和逻辑)•标准报告•验证仅限于测试工具的功能•不进行验证

  2. Advantages • Good usability and re-usability • Good test flow coverage • Multi-environment support • Data and code are separate • Reproducible test results 优势•良好的可用性和可重用性•良好的测试流程覆盖率•多种环境支持•数据和代码是分开的•可重现的测试结果

  3. Disadvantages • Quality and coverage strongly depends on the automation skills of implementing person • Continuous maintenance issues due to a big amount of the code • Exit on fail • Manual validation is required 缺点•质量和覆盖范围在很大程度上取决于实施人员的自动化技能•由于大量代码而导致的持续维护问题•失败退出•需要手动验证

  4. Applicability • Good fit for a single application testing, featuring multi-environment, big datasets, and rarely changing Test Cases • Batch-run capable with additional development efforts • Limited set of checkpoints, as any Database / Data Input change breaks verification and requires recapture • Shared across the team workspace (environment, data, etc.) required (possible issues with offshore support) • Mid-term automation goals 适用性•非常适合单一应用程序测试,具有多环境,大数据集,并且很少更改测试用例•批处理运行,需要额外的开发工作•有限的检查点集,因为任何数据库/数据输入更改都会破坏验证并需要重新捕获•所需的整个团队工作空间(环境,数据等)共享(离岸支持可能出现的问题)•中期自动化目标

Front-End Test Automation Practices – Keyword-Driven Framework 前端测试自动化实践–关键字驱动的框架

  1. Description • Pure programmatically • Parameterized, capable to import spreadsheets • GUI/Database checkpoints, hard-coded and/or parameterized • Framework-based structure • Limited error handling • Keyword-based flow (logic and data in a spreadsheet) • Possibly extended reporting • Verification is limited to Testing Tool's capabilities • No validation 描述•纯编程方式•参数化,能够导入电子表格•GUI /数据库检查点,硬编码和/或参数化•基于框架的结构•有限的错误处理•基于关键字的流程(电子表格中的逻辑和数据)•可能扩展的报告•验证仅限于测试工具的功能•不进行验证

  2. Advantages • Good usability and re-usability • Compact code • Test development doesn't require programming skills • Good test flow coverage • Multi-environment support • Data and code are separate • Reproducible test results 优势•良好的可用性和可重用性•紧凑的代码•测试开发不需要编程技能•良好的测试流程覆盖率•多环境支持•数据和代码是分开的•可重现的测试结果

  3. Disadvantages • Requires initial investment for design and implementation of the Framework • Due to keywords limit doesn't allow covering very complicated Test Cases • Meta-language specific training is required for staff • Version control issues • Exit on fail • Manual validation is required 缺点•需要对框架的设计和实施进行初期投资•由于关键字限制,不能涵盖非常复杂的测试用例•需要对元语言进行特定的培训给员工•版本控制问题•失败时退出•需要手动验证

  4. Applicability • Good fit for a multi-application testing (same platform), featuring multi-environment, big datasets, and a big number of short and straight Test Cases • Test Plan / Test Scenario execution (Batch run) • Limited set of checkpoints, as any Database / Data Input change breaks verification and requires recapture • Better support of distributed teams, especially with extended reporting implemented • Multi-tool support for the meta-language • Mid- and long-term automation goals 适用性•非常适合用于多应用程序测试(同一平台),具有多环境,大数据集以及大量简短的测试案例•测试计划/测试方案执行(批量运行)•有限的检查点集,因为任何数据库/数据输入更改都会破坏验证并需要重新捕获•更好地为分布式团队提供支持,尤其是实施了扩展报告时•对元语言的多工具支持•中长期自动化目标

Front-End Test Automation Practices – Hybrid Keyword/Data Driven Framework 前端测试自动化实践–混合关键字/数据驱动框架

  1. Description • Pure programmatically • Internal Data Model, capable to import/export data from various sources • GUI/Database checkpoints, parameterized/transitioned • Business Verification Rules • Framework-based structure; 描述•纯编程方式•内部数据模型,能够从各种来源导入/导出数据•GUI /数据库检查点,已参数化/已转换•业务验证规则•基于框架的结构; capable to integrate external objects (ie MSXML DOM) • Exception handling and recovery capabilities • Test Case oriented execution (business logic outside of the code) • Data-driven input & verification • Extended business reporting • AI-based validation methods 能够集成外部对象(即MSXML DOM)•异常处理和恢复功能•面向测试用例的执行(代码外部的业务逻辑)•数据驱动的输入和验证•扩展的业务报告•基于AI的验证方法

  2. Advantages • High usability and re-usability • Compact and scalable architecture • Test Plan / Test Scenario creation doesn't require programming or training on the Testing Tool • Extensive test flow coverage • Multi-application support • Data and code are separate • Reproducible and proven test results, convenient and transferable Test Reports • Built-in Consistency and Severity Validation 优点•高可用性和可重用性•紧凑和可扩展的体系结构•测试计划/测试方案的创建不需要在测试工具上进行编程或培训•广泛的测试流程覆盖范围•多应用程序支持•数据和代码是分开的•可重复且可重用经过验证的测试结果,方便且可转移的测试报告•内置的一致性和严重性验证

  3. Disadvantages • Requires initial investment for design and implementation of the Framework 缺点•需要为框架的设计和实施进行初步投资

  4. Applicability • Comprehensive Functional Testing for multi-application, multi-platform products, featuring huge number of complicated Test Cases • Smoke-Regression-Sanity Testing Cycle with extensive coverage and validation • Test Plan / Test Scenario execution (Batch run) • Big and changeable data set and data transitioning cases • Excellent support of distributed teams • Integration with other testing tools • Mid- and long-term automation goals 适用性•针对多应用程序,多平台产品的全面功能测试,具有大量复杂的测试用例•烟熏回归-健全性测试周期,覆盖范围广且经过验证•测试计划/测试方案执行(批量运行)•规模大而可变数据集和数据转换案例•分布式团队的出色支持•与其他测试工具的集成•中长期自动化目标

It sounds like your question is specific to HP's QTP/BPT. 听起来您的问题是针对HP的QTP / BPT的。 Here are the differences. 这是区别。 QTP is really the 'engine' that is used by both BPT and QTP. QTP实际上是BPT和QTP都使用的“引擎”。 QTP provides two main views for working with scripts. QTP提供了两个主要的脚本视图。

QTP: The first is the 'Keyword' view which presents a tree of actions and functions. QTP:第一个是“关键字”视图,它显示了动作和功能树。 This mode is suited for beginners and allows them to select objects from either the application or from the object repository as well as selecting the methods to be performed on the objects. 此模式适合初学者,允许他们从应用程序或对象存储库中选择对象,以及选择要在对象上执行的方法。 The script is then generated automatically. 然后将自动生成脚本。

The second is the 'Expert' view which allows the display and editing of the scripts source code. 第二个是“专家”视图,该视图允许显示和编辑脚本源代码。 The expert veiw provides an IDE for developing the scripts. 专家级专家为开发脚本提供了一个IDE。 This view is suited for advanced users. 此视图适合高级用户。

BPT is based on the concept of creating test cases from re-usable business components which in turn are created from keywords. BPT基于从可重用业务组件创建测试用例的概念,而可重用业务组件又是从关键字创建的。 This keyword-driven approach simplifies the process of test case creation by providing a gui that allows the user to 'drag and drop' components to build the test. 这种关键字驱动的方法通过提供允许用户“拖放”组件以构建测试的gui简化了测试用例的创建过程。 the script is generated automatically. 该脚本是自动生成的。

It depends what you are trying to accomplish in your particular situation. 这取决于您在特定情况下要完成的工作。 One thing that is universal, however, is that test automation is software development, and needs to be treated as such. 然而,普遍存在的一件事是测试自动化就是软件开发,因此需要被视为软件开发。 Use sound design and coding practices. 使用合理的设计和编码实践。 It sounds like you are new to automation. 听起来您是自动化的新手。 Often a good place to start is building a smoke test that will quickly run for each new build. 通常,一个好的起点是进行烟雾测试,该烟雾测试将针对每个新版本快速运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM