Patches item #1531873, was opened at 2006-07-31 19:21
Message generated for change (Comment added) made by gjoseph
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=497984&aid=1531873&group_id=61302

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Grégory Joseph (gjoseph)
Assigned to: Nobody/Anonymous (nobody)
Summary: Support for image validation

Initial Comment:
Here's a quick attempt at making it possible to
validate image in pages with jwebunit.
What it can do:
* validate that an image tag is present on a page.
(currently using the src and alt attributes values)
* validate that an existing image tag points to a
*real* image which is loadable by java's ImageIO.
* save such an image as png for potential further
testing/processing
* retrieve a java.awt.Image instance based on the
above, for potential further testing/processing

I think the code is self explanatory or commented where
necessary. I had to add/fix a few things here and there
as you'll see.

One thing that c/should be improved is the way the
image tags are checked upon. Maybe using a (partial)
xpath expression as the method parameter, rather than
src and alt? A more versatile solution would probably
be to expose an HtmlImage object - which could be
retrieved in various ways (src, alt, id, ...) from the
current page, then passed in to the various validation
methods (validate this is a real image, save it to
disk, etc..)

(This last remark is actually valid for many other
stuff in jwebunit's api, in my opinion, but that's
really another topic ;))

Let me know what you think !



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

>Comment By: Grégory Joseph (gjoseph)
Date: 2006-07-31 19:27

Message:
Logged In: YES 
user_id=1562006

Oops, just realized I wrote this against the 1.x branch -
let me know if it also works against the trunk - if the
trunk is useable, I guess I could switch anyway.

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

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

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jwebunit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development

Reply via email to