Am 30.11.2009 um 20:47 schrieb Marc Guillemot:
> Hi,
>
> I think that it is not possible with the current WebDriver API that can
> only return WebElement(s) for a finder. In fact it is a pity because
> XPath is really powerful and can be used to access text nodes of course
> but as well the result of some aggregation (count(...)) for instance.
I had a slightly different problem with something like this:
<caption>
<span>Just a test</span>
<input type="button".../>
Foobar my heart
</caption>
where I wanted to get any element with text containing "Foobar".
I first tried sth. like this:
//*[contains(text(), "Foobar")]
However this did not find the caption.
Now I have
//*/text()/[contains(., "Foobar")]
and this does find "Foobar"
So maybe //div/text() will work?
Regards
Mirko
> Cheers,
> Marc.
>
> John Lockhart a écrit :