---
title: "Watij - Web Application Testing in Java"
author: "sole"
date: "2008-05-29T16:54:07Z"
tags: []
slug: "watij-web-application-testing-in-java"
draft: false
lastmod: "2008-05-29T16:54:07Z"
id: 198364
url: "https://hex.iteye.com/blog/198364"
---

**发现一个抓取动态网页的好东东：**   

**Watij** (*pronounced wattage*) stands for Web Application Testing in Java. **Watij** is a pure Java API created to allow for the automation of web applications. Based on the simplicity of [Watir](http://wtr.rubyforge.org/ "http://wtr.rubyforge.org/") and enhanced by the power of Java, **Watij** automates functional testing of web applications through a real browser. Currently **Watij** supports automating Internet Explorer on Windows only. Future plans are in place to support others like Mozilla.

Just [download Watij](https://sourceforge.net/project/showfiles.php?group_id=165206 "https://sourceforge.net/project/showfiles.php?group_id=165206"), unzip, and double-click on the *launchWatijBeanShell.bat* and you are ready to start scripting in the BeanShell Desktop console.

 how easy it is to script a search on Google:

```
IE ie = new IE();
ie.start("http://www.google.com");
ie.textField(name,"q").set("Watij");
ie.button("Google Search").click();
```

***Now don’t stop here!*** Take a look at the [**Quick Start Guide**](http://hex.iteye.com/wiki:quick_start "wiki:quick_start") and begin writing your Watij test scripts in test runners like [**JUnit**](http://www.junit.org/ "http://www.junit.org") or others like [**TestNG**](http://testng.org/ "http://testng.org").

**Note:** *Requires* java version [jdk 1.5](http://java.sun.com/j2se/1.5.0/download.jsp "http://java.sun.com/j2se/1.5.0/download.jsp"). See the [Quick Start](http://hex.iteye.com/wiki:quick_start "wiki:quick_start") page for more details.