Watij maturity

14 views
Skip to first unread message

Mathieu BERGOUNIOUX

unread,
Feb 5, 2010, 3:58:15 PM2/5/10
to watij
Hi all,

I'm new to Watij and I find it hard to understand how mature it is.
I've used Google for my investigation and I'm confused by the results
I get.

Allow me to list a few things that make me think it's still a bit
young (no offense - and feel free to correct me if I wrote nonsense) :
- the JavaDoc has no comments. It simply *lists* all Objects/methods.
Except the basic "google" tutorial, you're pretty much on your own to
understand how things should be used.
- the JavaDoc is not up-to-date (for example "waitUntilActive" does
not appear in it)
- essential things like "IE.status()" are not implemented (it throws
exception "NotImplementedYet"). I can't seem to find a way to check if
the browser window is ready AND the page loaded (and everything in
between). For example if I close the browser window while it's still
opening, my Watij application awaits forever.

On the other hand, contradictory information makes me think Watij is a
serious project :
- Couldn't find any equivalent API, except for "EZ Jcom", which is not
free
- It really looks like it's going to be powerful when it's finished
- The community is still (already?) active


My dream would be to find the Java equivalent of AutoIt, but I'm
starting to lose hope... :-)

So what's your opinion about Watij maturity?

Jake Dempsey

unread,
Feb 5, 2010, 4:24:47 PM2/5/10
to wa...@googlegroups.com
I'll try to address a few of the items.

We are not fans of comments in javadoc.  I personally think its noise.  I much rather see working unit tests to help me understand how to actually use something.  The biggest problem with documentation that is really just specialized comments is they they become stale and out of sync.  Working unit tests are always up to date.  Watij has a full suite of unit tests outlining and showing all the functionality.

I will agree that the documentation is lighter than it could be but I do think that these three pages give you the nuts and bolts of what you need:
- http://watij.com/wiki:quick_start
- http://watij.com/wiki:user_guide
- http://watij.sourceforge.net/docs/api/index.html?watij/IE.html

With the three above resources + this google group, I find that people catch on very quickly.

I'll be the first to admit that we need to update watij.  The java to com bridge that we use from TeamDev has had newer libraries out for some time and we need to incorporate those.  There is probably a list of stuff we need to tackle.  What I have found, and anyone here can please correct me, is that watij does what it does pretty well and even though it needs to be freshened up it still works.

As to its maturity, we have had about 27k downloads and it has been used since 06. With the available resources and the community support, I would say watij is mature.

Hope that helps

Jake Dempsey
www.starterstep.com




--
You received this message because you are subscribed to the Google Groups "watij" group.
To post to this group, send email to wa...@googlegroups.com.
To unsubscribe from this group, send email to watij+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/watij?hl=en.


Mathieu BERGOUNIOUX

unread,
Feb 5, 2010, 10:55:05 PM2/5/10
to watij
OK, I didn't think about running the unit tests!

However, there is this specific issue I need to address: how to you
detect the exact state in which is an IE window ? (opening the window,
not responding, loading the page, finished loading the page...)

On 5 fév, 21:24, Jake Dempsey <angelo0...@gmail.com> wrote:
> I'll try to address a few of the items.
>
> We are not fans of comments in javadoc.  I personally think its noise.  I
> much rather see working unit tests to help me understand how to actually use
> something.  The biggest problem with documentation that is really just
> specialized comments is they they become stale and out of sync.  Working
> unit tests are always up to date.  Watij has a full suite of unit tests
> outlining and showing all the functionality.
>
> I will agree that the documentation is lighter than it could be but I do
> think that these three pages give you the nuts and bolts of what you need:
> -http://watij.com/wiki:quick_start
> -http://watij.com/wiki:user_guide

> -http://watij.sourceforge.net/docs/api/index.html?watij/IE.html


>
> With the three above resources + this google group, I find that people catch
> on very quickly.
>
> I'll be the first to admit that we need to update watij.  The java to com
> bridge that we use from TeamDev has had newer libraries out for some time
> and we need to incorporate those.  There is probably a list of stuff we need
> to tackle.  What I have found, and anyone here can please correct me, is
> that watij does what it does pretty well and even though it needs to be
> freshened up it still works.
>
> As to its maturity, we have had about 27k downloads and it has been used
> since 06. With the available resources and the community support, I would
> say watij is mature.
>
> Hope that helps
>
> Jake Dempseywww.starterstep.com
>
> On Fri, Feb 5, 2010 at 2:58 PM, Mathieu BERGOUNIOUX

> <monsieuro...@gmail.com>wrote:

> > watij+un...@googlegroups.com <watij%2Bunsu...@googlegroups.com>.

Mathieu BERGOUNIOUX

unread,
Feb 5, 2010, 11:21:51 PM2/5/10
to watij
I've had a look at the unit tests.
I'm starting to understand. I believe I should use the class
"NavigationEventAdapter() ".

Sounds cool!

darrell

unread,
Feb 6, 2010, 8:26:48 PM2/6/10
to watij
Watij is what it is. This is not a commercial product. If I talk to
the developers in my company and look at the code we produce there is
little commenting. Agile developers are really big on self-documenting
code. You should be able to look at the name of a method and know what
it does. You should be able to look at the unit tests and know how to
use it. If the code changes, unit tests will break. So the unit tests
really determine how the code is supposed to work. If there is an
intended change in functionality, there will be a change in the unit
tests. You can look at the history of the unit tests to see how the
functionality changes.

Basically, I can make the code do XXX even when the JavaDoc says it
does YYY. There is nothing forcing me to update the comments, i.e.
JavaDoc. If I write a unit test to show it does XXX but I implement it
as YYY then the unit test fails. Red bar, no ship. It is all about the
green bar.

From a consumer who just wants to read the documentation and use it as
documented, it is not a mature product. As a tool for automating test
via Internet Explorer, it is a mature product.

For all the things which are "NotImplementedYet" there is usually some
sort of work around.

The only thing I find lacking in Watij is that it does not support
other web browsers. I've had a lot of problems with IE (memory leaks,
hanging in '1 item remaining...', etc.). I see this as a well built
house (Watij) on top of a poor foundation (IE).

If you look at most the mature, open source automation tools, the ease
of maintenance just isn't there. I can write Watij code must faster
and easier than say Selenium-RC code. I can record Selenium test cases
faster but once I refactor them to eliminate: duplicate code,
inefficient locators, poor assumptions, magic numbers, timing issue,
etc. I find Selenium to be much slower to code than Watij.

Darrell

Alexey Bulat

unread,
Feb 7, 2010, 4:32:02 AM2/7/10
to wa...@googlegroups.com
Hello, 

Let me add some comments.
1. Watij is written in Java but it doesn't follow to basic "Code Conventions for the Java Programming Language", so for me in the beginning it was very uncomfortable to use it.
Java Naming Conventions
Methods: should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized. Examlple: getForms(), setForm(...) and so on.

Watij uses:
Class IE - Metods: form(...), forms(), frame(...), frames(), label(..), labels()


2. There are a lot of places where you can easily get NullPointerEceptions. It is still annoying me.
Example:
package watij;
class: BaseHtmlFinder
method:
public Button button(Finder... finder) throws Exception {
return buttons(finder).get(0);
}

From my sight the following implementation would be better:
public Button button(Finder... finder) throws Exception {
Buttons buttons = buttons(finder);
return (buttons != null) ? buttons(finder).get(0) : null;
}

3. Lack of javadocs and up-to-date documentation is also minus for Watij.

But any way I agree with Darrell it is much faster to start writing tests using Watij than any other java based frameworks.

Thanks a lot,
Alexey Bulat

--
You received this message because you are subscribed to the Google Groups "watij" group.
To post to this group, send email to wa...@googlegroups.com.
To unsubscribe from this group, send email to watij+un...@googlegroups.com.

Jake Dempsey

unread,
Feb 7, 2010, 5:20:41 PM2/7/10
to wa...@googlegroups.com
Alexy,

Watij uses the naming convention of Watir.  The concept for Watij was born out of the desire to create a java framework for automating IE as fluid as the Watir api, but provide the flexibility to existing java developers. 

I do like your approach for the finders to return null vs thrown the npe. That is the first time I have seen that as a recommendation though.  As in my previous post and also from Darrell post, I dont see the lack of javadoc as a minus.  I see it as a plus because we rely on expressive methods and unit tests to document the code.  

Do you not find the user guide, quick start guide, and api to be enough to get started with watij?  What in particular needs better documentation?
 
Maybe I can start a sticky thread for needed improvements and everyone can provide specific items (docs, imps, etc) that are needed. Do you think that will help?

Jake

darrell

unread,
Feb 8, 2010, 12:10:12 PM2/8/10
to watij
Jake,

I think a note about how to use Watij would be helpful. I work on a
scrum team and completely understand why Watij lacks JavaDocs.
Traditionally programmers and testers are going to be coming from a
place where documentation is required. A note about how they can
figure out the usage of Watij and most importantly, WHY JavaDocs are
not a good use of time would (a) help people get into the right
mindset for Watij and (b) understand some of the benefits of TDD and
ignoring comments as a primary form of documentation.

Darrell

On Feb 7, 5:20 pm, Jake Dempsey <angelo0...@gmail.com> wrote:
> Alexy,
>
> Watij uses the naming convention of Watir.  The concept for Watij was born
> out of the desire to create a java framework for automating IE as fluid as
> the Watir api, but provide the flexibility to existing java developers.
>
> I do like your approach for the finders to return null vs thrown the npe.
> That is the first time I have seen that as a recommendation though.  As in
> my previous post and also from Darrell post, I dont see the lack of javadoc
> as a minus.  I see it as a plus because we rely on expressive methods and
> unit tests to document the code.
>
> Do you not find the user guide, quick start guide, and api to be enough to
> get started with watij?  What in particular needs better documentation?
>
> Maybe I can start a sticky thread for needed improvements and everyone can
> provide specific items (docs, imps, etc) that are needed. Do you think that
> will help?
>
> Jake
>
>
>
> On Sun, Feb 7, 2010 at 3:32 AM, Alexey Bulat <alexeybu...@gmail.com> wrote:
> > Hello,
>
> > Let me add some comments.
> > 1. Watij is written in Java but it doesn't follow to basic "Code
> > Conventions for the Java Programming Language", so for me in the beginning
> > it was very uncomfortable to use it.

> > *Java Naming Conventions*


> > Methods: should be verbs, in mixed case with the first letter lowercase,
> > with the first letter of each internal word capitalized. Examlple:
> > getForms(), setForm(...) and so on.
>

> > *Watij uses:*


> > Class IE - Metods: form(...), forms(), frame(...), frames(), label(..),
> > labels()
>
> > 2. There are a lot of places where you can easily get NullPointerEceptions.
> > It is still annoying me.

> > *Example:*


> > package watij;
> > class: BaseHtmlFinder
> > method:
> > public Button button(Finder... finder) throws Exception {
> > return buttons(finder).get(0);
> > }
>

> > *From my sight the following implementation would be better:*


> > public Button button(Finder... finder) throws Exception {
> > Buttons buttons = buttons(finder);
> > return (buttons != null) ? buttons(finder).get(0) : null;
> > }
>
> > 3. Lack of javadocs and up-to-date documentation is also minus for Watij.
>
> > But any way I agree with Darrell it is much faster to start writing tests
> > using Watij than any other java based frameworks.
>
> > Thanks a lot,
> > Alexey Bulat
>

> >> watij+un...@googlegroups.com <watij%2Bunsu...@googlegroups.com>


> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/watij?hl=en.
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "watij" group.
> > To post to this group, send email to wa...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > watij+un...@googlegroups.com <watij%2Bunsu...@googlegroups.com>.

Mathieu BERGOUNIOUX

unread,
Feb 9, 2010, 4:13:16 PM2/9/10
to watij
Thanks for all your replies. They helped a lot.
To be honest, at first I was a bit surprised (not to say shocked :-D),
because it must be the very first time in my life that I read an
answer that (more or less says) "documenting the methods is for n00bs,
real programers read the code to understand it." You must admit that
it litterally contradicts the traditionnal "RTFM" answer.

However, now I understand the motivations behind that choice better.
Once again, thanks for the replies, they were of great value.

Still, even reading the test units confuses me a bit.

For example, the IEEventHandler class, which seems to be the only one
allowing to control accurately an IE browser, appears only in the
IEAutomationTest.java file. However, it seems to be used by pretty
much anything there except the "IE" class. Is it relevant to use the
"IEAutomation" class to control IE? (it's not even part of Watij so
what's the point?).

I'm sure there is a rational answer to my questions above. But I hope
they highlight that the way to use Watij (except for very basic and
obvious tasks) is not so easy for a newcomer.

Jake Dempsey

unread,
Feb 9, 2010, 9:02:23 PM2/9/10
to watij
Sorry if I sound a bit confused, but what are you trying to do
exactly? If you are trying to drive internet explorer
programmatically then your interface should be to use the IE class.
You create an instance of IE and use it to naviagte to urls and access
dom elements and interact with them.

Have you read this: http://watij.com/wiki:user_guide ?

Jake

Mathieu BERGOUNIOUX

unread,
Feb 10, 2010, 6:04:11 AM2/10/10
to watij
See the other thread I created ("Definition of 'Ready'?")
Reply all
Reply to author
Forward
0 new messages