opensubscriber
   Find in this group all groups
 
Unknown more information…

j : jwebunit-users@lists.sourceforge.net 24 July 2009 • 4:30AM -0400

[JWebUnit-users] Find Element on page
by Stand Trooper

REPLY TO AUTHOR
 
REPLY TO GROUP






Ok, so I've been toying with this for a day or so without revelation, so I'm
hoping that I can find the answer here.  I've searched the cryptic archives
and read javadocs and even played with a lot of different things.

What I need to do is find out if an element is present before I move on.

for example:
if (elementExists("//div[@id='bob']")) {
//perform action
}

or even an override to getElement that passes a boolean to not do the
assertion, if the element doesn't exist it returns a null object.

Right now, I have a series of interactions on forms that may cause errors
that I'm testing, if an error displays, then an element will show up on the
page.  I'm doing about 295,000 automated tests right now and I'll be bumping
that up to about 895k tests once these are done.  I can't just do an
assertTextPresent or assertTextNotPresent, I need to detect if something is
there, if it is, then perform a specific action and move on without taking
down the tests and having to start over.

Is there anything like that that I can use?  If not, that's ok, I'll have to
write some code, unless someone has something quick in mind.

thx

timo
StandTrooper

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.