How to automate testing of a browser-based app? [closed]
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
开发者_高级运维 Improve this questionIf it were a windows program, I would use Auto it to automate testing. Is there something similar for browser-based apps?
Nothing too complex, it should just allow scripting (preferable for me to macro-recording) to simulate human interaction with the browser, which means being able to identify fields of a form by name, inject text into some, simulate mouse-click on others, etc and then, after submitting a form, should be able to read text certain named controls, check the status of others (checked, radio group index, read-only, etc).
While I do appreciate a full featured product, I don't appreciate a steep learning curve. so something as simple as the scripting of Auto It woudl be fine.
I don't know if it makes a difference which browser is used, but I could live with MSIE 6 or higher (maybe 7 or higher at a push).
Edit: Three posters so far (out of three) recommend Selenium. One says it is FireFox only and I need to test MSIE, however some quick googling shows that this should be possible (although you might have to set everything up in FF first, then switch over to MSIE).
See http://www.emadibrahim.com/2009/01/19/testing-web-app-with-selenium-explorer-and-net/ and http://wiki.openqa.org/display/SEL/Selenium+Core+FAQ Hope this helps someone.
You have several options to choose from:
- Selenium
- Watin/Watir
- HtmlUnit
Sahi is another option. (We user sahi and selenuim)
Selenium would an the ideal tool for this.
I'd recommend Selenium, though it's for Firefox.
Try out Celerity. It renders javascript and works without a browser
Selenium is widely used, mostly because of their recorder (which is supported only in FF, but you can then replay the tests hitting IE). Its language is commonly referred as "Selenesse". It's also a great choice if you expect to do some performance testing in a grid... but it seems this is not your case.
However, I would recommend not to use Salenium/Selenesse; instead, look for Selenium + Webdriver (Selenium 2), which is still in beta. The language construct are much better (but you don't have a recorder).
Other good option is Sahi. I found its API to be easier, in the sense that Sahi's code tries to deal itself with the problem of finding the button/link/etc you want him to click. For example, instead of relying in complex XPath expressions, you can say something like "click the link tag nearest to the div with attribute id="menu" (you can do this with one line of code). It has also a recorder.
I want to recommend something I found last week and definitely think that this is interesting.
- QA Agent (http://qaagent.com)
It allows you to create web automated test in your browser. I really liked that it is free and you don't need to install anything. It looks like this is a new initiative so there are a lot of improvements which can be done.
精彩评论