users
[Top] [All Lists]

Re: [cinjug-users] HttpUnit and javascript

To: bill.manuel@xxxxxxxxxx
Subject: Re: [cinjug-users] HttpUnit and javascript
From: Brian Bonner <brian.bonner@xxxxxxxxxxxx>
Date: Fri, 29 Apr 2005 17:09:16 -0400
Cc: users@xxxxxxxxxx
Delivered-to: mailing list users@cinjug.org
In-reply-to: <OF8F7781AF.AFC838C9-ON85256FF2.006F4B4E-85256FF2.00706047@kroger.com>
Mailing-list: contact users-help@cinjug.org; run by ezmlm
References: <OF8F7781AF.AFC838C9-ON85256FF2.006F4B4E-85256FF2.00706047@kroger.com>
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)
Hey, Bill,

Seems to me you can grab the element by ID (you'll have to add it). We did something similar to this on a past project.
<tr id="xyz" onclick="takeOverTheWorld();><td>some text</td></tr>
*HTMLPage page;
...
page.getElementWithID*("xyz").getScriptableDelegate().


and so on.

BTW, I may not have this exactly correct, but hopefully that will help you.

Brian



bill.manuel@xxxxxxxxxx wrote:



All,
     I'm trying to do some web page testing using HttpUnit.  I am having
trouble calling some javascript methods on my page in my test.  I am trying
to call the onclick event on a table row :
     <tr onclick="takeOverTheWorld();><td>some text</td></tr>

In HttpUnit, it seems pretty easy to get a handle on the table (WebTable)
and each individual cell.  Once you have either the table or a cell in the
table you are able to call
object.getScriptableElement().doEvent("onclick").  This would work fine if
I put the onclick on each individual <td> tag.  UGHHH.  That would repeat
for every cell in the row.  Does anyone know how to get a reference to a
<tr> and then call the doEvent() method.  I've been digging through this
for a while with no success.

Thanks in advance for any help you can provide.

Bill Manuel




--------- You may unsubscribe from this mailing list by sending a blank email addressed to: users-unsubscribe@xxxxxxxxxx

--
Find additional help by sending a blank email
addressed to:
users-help@xxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>