Hi Julien,

> So I think position() is a 1-based index. You can also use the abbreviated 
> syntax

This works:
clickElementByXPath("//[EMAIL PROTECTED]'portletMVC']/table//a[1]");
This does not (AssertionFailedError):
clickElementByXPath("//[EMAIL PROTECTED]'portletMVC']/table//a[2]");

There are more than two anchor elements somewhere in the table. It looks like 
the "selector" ([1]) is ignored in the first example...

> How can you count the number of columns with XPath ? Could you please
> provide an example ?

Something like this:
// test if the table has 5 columns in the first row
assertNumberOfElements(5, "[EMAIL PROTECTED]'foobar']/tr[1]/td");

This could be used to count rows, columns, tables, whatever.

Having some more flexible XPath assertions would be very useful, whenever the 
rest of the API does not provide the necessary method. Eg. when I need to check 
for a table that has neither ID nor summary, I could use XPath to find it.

Another problem I'm facing:
A constructor like it is proposed in the "Quick Start" produces a 
NullPointerException with the call to getTestContext(). If I move the call  
getTestContext().setBaseUrl(...) from the constructor to setUp(), it works. But 
this way every single test has to do a login to my webapp, therefore slowing 
down testing a lot. It would be nice to login only once and then go back to the 
root ( beginAt("/"); ) within setUp(). Any ideas why the constructor does not 
work?
-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*. Nur noch kurze Zeit!
"Feel free" mit GMX DSL: http://www.gmx.net/de/go/dsl

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jwebunit-users mailing list
Jwebunit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to