Which is better for web testing? Record-Play automation or coding? [closed]

旧时模样 提交于 2019-12-22 08:52:16

问题


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?


回答1:


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.

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"

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.




回答2:


Coding is by far better. With record-play systems if any aspect of the page changes you have to go rerecord the entire test suite. With coding and proper design you can then go change the functions that interact with that one area and all the tests will start to work.




回答3:


I would say both -- record as much as possible, then tweak the recorded code to test as you need. That assumes, of course, that your recorder emits code you can edit.




回答4:


So far QTP is the best. But keep in mind - it's a powerful platform first. If you don't want to sink in maintenance of record/playback scripts you will need to develop your custom framework (go for keyword-driven) or buy HP BPT.

There is a range of low budget and open source tools as well.




回答5:


It also depends on the complexity of the web app you wanna test.

Saying it in a different way and thinking working in an office, depends as well on how close with the DEVELOPERS you are working.

Spending time looking for your app's functions and nomeclatures can sure be avoided when you known your DEVELOPER teams has your back.

What is your case?

PS: Coding is better ;)



来源:https://stackoverflow.com/questions/142398/which-is-better-for-web-testing-record-play-automation-or-coding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!