Bugs item #998757, was opened at 2004-07-27 09:48
Message generated for change (Comment added) made by jimweaver
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=998757&group_id=61302

Category: None
Group: Release 1.2
>Status: Pending
>Resolution: Fixed
Priority: 5
Submitted By: Andrei Pavlenko (andreipavlenko)
>Assigned to: Jim Weaver (jimweaver)
Summary: WebLink.click method does not work

Initial Comment:
WebTable tableWithSmallButtons =
getDialog().getWebTableBySummaryOrId("my-id-small.buttons");
WebLink webLinkMoveUp =
tableWithSmallButtons.getTableCellWithID("link.move.up").getLinks()[0];

webLinkMoveUp.click(); // does not work
assertTextPresent("some expected response text");

----------------------------------------------------------------------

>Comment By: Jim Weaver (jimweaver)
Date: 2004-09-13 17:32

Message:
Logged In: YES 
user_id=619947

Hi again,

Someone else had a similar problem - they were wanting to
write a method to find a link by the full html body of the
link, then click it.  What I've done to support their
request will also work for you, if you don't like the Id
suggestion I made above.  In the next release,
submitRequest(WebLink) on HttpUnitDialog will be protected,
so you can pass your link (webLinkMoveuUp) into that method,
and it will click it for you and update the response state
on the dialog.

----------------------------------------------------------------------

Comment By: Jim Weaver (jimweaver)
Date: 2004-09-13 17:18

Message:
Logged In: YES 
user_id=619947

Hi, 

I don't think this is exactly a bug.

The problem here is that you are mixing access of HttpUnit
objects (WebTable and WebLink) with jWebUnit assertions. 
The direct cause of your problem is that the jWebUnit
HttpUnit dialog keeps state of the current response, and
when you directly click the link webLinkMoveUp without going
through the jWebUnit API, that state is lost and subsequent
assertions will not work as you expect.

My advice would be to put an "id" attribute on your link
elements and access the link through the jWebUnit API by id,
rather than navigating the cells of the table as you are
currently doing.  Try a dynamic id attribute where the row #
is in the generated id.  For instance, for the 1st row's
move up link you could have the id generated as
"link.move.up.1".

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497982&aid=998757&group_id=61302


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM. 
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Jwebunit-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to