Bugs item #998757, was opened at 2004-07-27 09:48
Message generated for change (Settings changed) 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.3
>Status: Closed
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: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
Jwebunit-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development