Additionally, if the url does not work for you you might want to
consider using the xpath. Normally I'd use something like:
ie.link(xpath, "//A[text()='Alerts']");
but if there are multiple links with the text 'Alerts', this will not
work. In those cases, I go up the tree until I find an id attribute.
For example, if the HTML is:
<TABLE id="alerts">
<TR>
<TD><A HREF="something.do?p=4&q=8">Alerts</A></TD>
</TR>
</TABLE>
I can use the xpath:
ie.link(xpath, "//TABLE[@id='alerts']/TBODY/TR[1]/TD/A[text()='Alerts']");
Darrell
2009/12/17 Jerald paul <paulj...@gmail.com>:
As for options to debug the script, switch to using an IDE. The bean
shell is good for some quick and dirty testing but for serious
development you need the tools of an IDE like Eclipse, IntelliJ,
NetBeans, etc.
- Create a project
- Import the Watij libraries (everything in the lib directory plus the
watij.jar)
- Create a jUnit TestCase
I just use the pre-built libraries. If you want to step into the Watij
source you can add the Watij src libraries to the source path of the
project.