我研究了一些ui测试工具,如htmlunit、httpunit、jwebunit、selenium等。
我对测试工具不是很熟悉。就javascript支持而言,Htmlunit听起来是个不错的选择。然后,我发现了jwebunit,它提供了API,与htmlunit相比,使用jwebunit编写简洁的代码是可能的。
有一件事我不太确定:当我们在htmlunit插件中使用jwebunit时,我们是否拥有了htmlunit的所有特性,或者jwebunit是否限制了htmlunit提供的某些特性的使用
发布于 2012-08-31 07:32:45
对于UI测试,还有另一个有趣的选择:使用Cannoo Webtest(基于HtmlUnit) +Groovy语言。您可以使用简单的DSL编写测试,例如(来自official site):
import com.canoo.webtest.WebtestCase
class SimpleTest extends WebtestCase {
void testWebtestOnGoogle() {
webtest("check that WebTest is Google's top 'WebTest' result") {
invoke "http://www.google.com/ncr", description: "Go to Google (in English)"
verifyTitle "Google"
setInputField name: "q", value: "WebTest"
clickButton "I'm Feeling Lucky"
verifyTitle "Canoo WebTest"
}
}
}https://stackoverflow.com/questions/12166943
复制相似问题