t
Table of Contents
Quick Start Guide 3.x
Note: Watij requires jdk 1.5 so if you don’t have it installed please do so here
Download Watij
- Click here to get the current release of Watij
- Unzip the watij_X_x.x.zip
Note: You can also [Get the Latest Source] and build it yourself
Setting up
- Place the jniwrap.dll into your system32 folder (Typically C:/WINDOWS/system32/)
- Open your favorite IDE and create a project...our favorite is IntelliJ
- Include watij.jar and all the jars in the lib folder in your classpath
- Create a Junit TestCase and make sure you include “import static watij.finders.SymbolFactory.\*;”
- Try out the simple example test below!
Note: The best examples are in the Unit Tests - just look in the folder /watij_X_x.x/src/java-test/watij
Example Google Search Test
import junit.framework.TestCase; import static watij.finders.SymbolFactory.*; public class GoogleTest extends TestCase { public void testGoogleSearch() throws Exception { IE ie = new IE(); ie.start("http://www.google.com"); ie.textField(name,"q").set("Watij"); ie.button("Google Search").click(); assertTrue(ie.containsText("/Web Application Testing in Java/")); } }
Note: Don’t forget to check out the Javadoc API for Watij
Using BeanShell
More Documentation
See our User Guide and FAQ for more information on using Watij. Also you can join our Google group and leverage the Watij community to learn more.
