We are now using Watij for the web automation. The API appears to have all the functionality that we need.
The only issue that we have is that previously we used commercial tools like SilkTest where you were able to define a page's objects in a class. This offered us great reusability and meant that maintenance was at a minimum as the page declarations only had to be modified in one place if a page's tags changed.
Is there a way to implimenting a similar design in Java?
Currently any scripts we have running - use the DOM object tags which will change in future builds and mean high test script maintenance with each release. e.g. a table tag in the current build is "N225D8" but this will change in the next - please see the code example below.
Im glad that you are utilzing watij and are finding it useful. You should not be writing test cases using watij directly. This will most likely be very procedural and unmaintainable. What you want to do is model the application under test using watij. Lets say you have a login page and right now you may have something like:
This does not model the application. What you really have is a "User" who can login. So you may want to create a class called User which takes in an IE object for its constructor and then has a login method which takes a username and password and sets the fields and clicks the login button. Then your test can look like:
//assume ie is initialized in the setup User myUser = new User(ie); myUser.login("JakeDempsey", "SecretPassword"); assertTrue(myUser.isLoggedIn());