Patches item #1531873, was opened at 2006-07-31 19:21 Message generated for change (Settings changed) made by henryju 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: Release 1.4 >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Grégory Joseph (gjoseph) Assigned to: Julien HENRY (henryju) 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: 2007-01-02 21:35 Message: Logged In: YES user_id=1562006 Originator: YES Cool, thanks! haven't been following up on jwebunit for a while, but I should get back to this soon, so Ill check the upcoming v2 ;) ---------------------------------------------------------------------- Comment By: Julien HENRY (henryju) Date: 2007-01-02 17:53 Message: Logged In: YES user_id=1235926 Originator: NO OK, I took the time to look at your promising work. It works fine. I just made some changes, especially for images with no alt attribut. I will commit it in 1.x branch, as trunk is broken. Concerning your opinion about jwebunit api, I agree with you, and it's typically what I want to do in 2.x. ---------------------------------------------------------------------- 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
