这是Web测试更好?录音播放自动化或编码? [英] Which is better for web testing? Record-Play automation or coding?

查看:173
本文介绍了这是Web测试更好?录音播放自动化或编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个新的项目,我想知道哪些自动化工具是最好的使用。我应该记录播放或code?

I am working on a new project and I wanted to know which automation tool is the best to use. Should I record-play or code?

推荐答案

我已经做了很多的硒浏览器自动化软件包,并且我发现记录的再inforces 的现有的应用程序设计,而编码的驱动器的设计灵活,可维护的方向发展。

I've worked a lot with the Selenium browser automation software packages, and I find that recording re-inforces the existing application design, while coding drives the design in a flexible and maintainable direction.

具体来说,我已经找到了实践效果最好是写剧本,你不知道现有的HTML标记说,一个较高的水平,pretending。非常努力地保持脚本的可读性。

Specifically, the practice I've found works best is to write the script a high level, pretending that you have no idea what the existing HTML markup says. Try very hard to keep the script readable.

open /
click "Ask a question"
type title, "What does ?SYNTAX ERROR ON 20 mean?"
type body "This is an example question, asked by an automated testing robot."
click "Ask your question"

如果脚本不运行,不改变脚本 - 更改HTML。添加ID或类或职称的元素所在的剧本告诉你需要他们。这需要一点时间,但它可以确保你的脚本是维护和明显的,它使更多的脚本变得更加容易。

If the script doesn't run, don't change the script -- change the HTML. Add IDs or classes or titles to elements where the script "tells you" it wants them. It takes a little longer, but it ensures that your script is maintainable and obvious, and it makes further scripts much easier.

这篇关于这是Web测试更好?录音播放自动化或编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆