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: Mon, 02 May 2005 09:46:28 -0400
Cc: users@xxxxxxxxxx
Delivered-to: mailing list users@cinjug.org
In-reply-to: <OF9CDE338C.71B7F48C-ON85256FF5.0045C2A9-85256FF5.0045F27A@kroger.com>
Mailing-list: contact users-help@cinjug.org; run by ezmlm
References: <OF9CDE338C.71B7F48C-ON85256FF5.0045C2A9-85256FF5.0045F27A@kroger.com>
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)
Bill, you're right--it wasn't the tr tag that we were getting. I just checked the source for httpunit and TableRow is an inner class of WebTable--not very helpful w/o some rework to the source.

Amol sounded like he had a idea for you with htmlunit.

Brian



bill.manuel@xxxxxxxxxx wrote:



Brian,
     I was able to get a handle on each <tr> tag using what you described,
but it does not seem scriptable.  Any ideas?   I guess I will try to debug
the source to see if I can figure out why it is not scriptable.  What a
pain though.

Thanks for your response.


Bill Manuel Sun Certified Web Component Developer Supply Chain Systems The Kroger Co. (513) 762-1283 bill.manuel@xxxxxxxxxx


Brian Bonner <brian.bonner@par aware.com> To bill.manuel@xxxxxxxxxx 04/29/2005 05:09 cc PM users@xxxxxxxxxx Subject Re: [cinjug-users] HttpUnit and javascript





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






--------- 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





---------
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>