Dear All,
now I want to start to create tests based on jwebunit+dbuinit on my
webapplications... I will create tests also for just-existent pages.

I'm using a framework that generates the form-elements by its own with "runtime
generated" names, for this reason my solution was to assign an "ID" to the form
elements and access to them with this... Jwebunit hasn't this kind of feature
and now I will produce an extended class from Jwebunit test....

In this new class I will put a code snippet like:


private String getNameByID(String ID,WebResponse resp)
{
String result=null;
HTMLElement testo;
try {
testo=resp.getElementWithID("firstname");
result=testo.getName();
}
catch (Exception e)
{
System.out.println("exception...to debug...");
}


Is my previous method very inefficient? I suppose so... do you see a way to do
it better?


I'm not so skilled in sourceforge development process as regard my feature
request about this topic and I don't know how is planned this addition... I
enclose the feature request to this post.

Thanx

=================================
my previuous mails....

=================================
 Dear All,
I use a framework that generates all the form included
input types of any kind.... it gives to all form
elements proprietary names that I cannot discover at
runtime.
So is very difficult to use jwebunit to test this kind
of forms.

But I can use the id attribute for every form element,
button, submit... so now I'm asking you if I can access
(set, get the form values) using the ID...

Now I have a code snipped like this:

private String getNameByID(String ID,WebResponse resp)
{
String result=null;
HTMLElement testo;
try {
testo=resp.getElementWithID("firstname");
result=testo.getName();
}
catch (Exception e)
{
System.out.println("exception...to debug...");
}

return result;

}


I pass tho this method the "ID" and the httpunid
webresponse object to get the "name" of a form element...

I don't think this is an "optimal" solution....

Could you extend jwebunit to get this feature available?

Many thanks
Ivan

--------------------------------
Response:

Date: 2004-09-22 17:17
Sender: jimweaver
Logged In: YES
user_id=619947

Is this tapestry?

If so, it seems like I remember someone posting or telling
me about a way around that problem (fixing form element
names to specific values).



--------------------------------
My Re:Response:

Date: 2004-09-29 17:02
Sender: codarin
Logged In: YES
user_id=442311

I use dbforms,  another mvc framework.
I have to access to elements by id because this frameworks
writes form.elements with its own names.


===============================================================
thanks
ivan


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
_______________________________________________
Jwebunit-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to