简体   繁体   English

挤压 GUI 测试中的测试脚本指南

[英]guidelines for test scripts in squish GUI testing

我需要有关 GUI 应用程序自动化测试的测试脚本方面的帮助,我选择了 javascript 来设计脚本,但据我所知,测试脚本示例与 javascript 完全不同。

Use Squish's record feature to record tests based on your GUI interaction.使用 Squish 的记录功能根据您的 GUI 交互记录测试。

In my experience, this is the most robust and flexible way to write test suites.根据我的经验,这是编写测试套件的最健壮和灵活的方式。 As soon as you start refactoring or writing custom functions, your Squish code becomes tightly coupled with the application under test (AUT).一旦您开始重构或编写自定义函数,您的 Squish 代码就会与被测应用程序 (AUT) 紧密耦合。 This makes it hard to maintain the tests through changes to the AUT.这使得很难通过更改 AUT 来维护测试。

It is useful to work to have a flexible objects.map, so that as the AUT evolves, your tests retain meaning.使用灵活的 objects.map 很有用,以便随着 AUT 的发展,您的测试保持意义。 It's also useful to write AUT-specific analysis and reporting code.编写特定于 AUT 的分析和报告代码也很有用。

First of all.. It would be better to use another language then javascript.首先.. 最好使用另一种语言然后 javascript。 I prefered python because you can easily add third party modules and use oop.我更喜欢 python,因为您可以轻松添加第三方模块并使用 oop。

If you are starting to write test automation scripts for a large software it would be better to create an architecture.如果您开始为大型软件编写测试自动化脚本,最好创建一个架构。 In my last project I included abstraction layer classes which manage / control the gui of the aut (application under test).在我的上一个项目中,我包含了管理/控制 aut(被测应用程序)的 gui 的抽象层类。

The benefit of these structure is a quick respond of modification (new buttons etc).这些结构的好处是可以快速响应修改(新按钮等)。 Furthermore other test developers needn't to know how to interact with buttons, checkboxes etc because they have to use your methods from the abstraction layer.此外,其他测试开发人员不需要知道如何与按钮、复选框等交互,因为他们必须从抽象层使用您的方法。

The best way to learn how a squish test script works, is to record a simple example (login).了解压缩测试脚本如何工作的最好方法是记录一个简单的示例(登录)。 There you can see which functions to use.在那里您可以看到要使用的功能。 If the script works fine replace your text inputs with entries from a local tsv file and add a loop to create a bundle of test executions.如果脚本工作正常,请用本地 tsv 文件中的条目替换您的文本输入,并添加一个循环来创建一组测试执行。

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

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