Hi Roland
   We use the Webtest with JSF and JBoss Seam .  We have the problem with
the changing webtest id's which we handled in the following way :
   a) We instrumented the jsf libraries and the rich faces libraries with a
encodeBegin and encodeEnd method. This instrumentation code creates an xml
with the id's of the components . We wrote a webtest application that walks
all the links whenever we change the layout so that we get the newIds.

   b) These ids are in a build.properties and the tests refer to the
property name rather than the actual htmlId. For your example this will be
<clickElement htmlId=$idElement > and idElement is defined in the
properties  file which is imported . this way . The properties file is
generated by step a)

   c) I remember using the FileUpload in rich faces 3.2.1. Let me check and
see if we have a test case for it

Hope that helps
Regards
Hari

On Wed, Jun 4, 2008 at 11:10 AM, Rutz, Roland <[EMAIL PROTECTED]>
wrote:

> Hi,
>
> I'm a new Webtest user. Could anybody tell me, if Webtest works well in
> most situations with JSF and Javascript. We use JBoss Seam for our
> application and I'm currently trying to automatically upload a file to
> the server, for which a have to load a new page via a submenue with the
> clickElement function. But that does not work.
>
> Should I use another webtest function or does the webtest clickElement
> have a problem with JSF generated pages?
>
> I could login into the application and can verify some text on the
> responding page. But when I try to clickElement the new page where I
> have to select the file to upload will not be loaded by webtest.
>
> Does there exists a possibility to tell JSF to use fixed htmlId's. so I
> don't have to modify the already used htmlId's in my webtest scripts, if
> the layout changes?
>
> Attached I provide the code from the webtest script an the relevant
> automatically generated Javascript code.
> <clickElement description="Click Element upload file"
> htmlId="j_id6:j_id14" />
>
> Now the part from the Javascript page with form section. I used the id
> j_id6:j_id14  for the ClickElement action for the Upload File submenue:
>
>  id="j_id6:j_id14" onclick="this.className='dr-menu-item
> dr-menu-item-enabled rich-menu-item rich-menu-i
> tem-enabled ';
> A4J.AJAX.Submit('_viewRoot','j_id6',event,{'parameters':{'j_id6:j_id14':
> 'j_id6:j_id14'} ,'act
> ionUrl':'/myapp/pages/MyHome.seam'} );" onmouseout="if
> (RichFaces.Menu.isWithin(event, this)) re
> turn;    this.className='dr-menu-item dr-menu-item-enabled
> rich-menu-item rich-menu-item-enabled  ';    $('j_
> id6:j_id14').style.cssText=';';
> $('j_id6:j_id14:icon').className='dr-menu-icon rich-menu-item-icon ';
> E
> lement.removeClassName($('j_id6:j_id14:anchor'),
> 'rich-menu-item-label-selected');" onmouseover="if (RichFace
> s.Menu.isWithin(event, this)) return;    this.className='dr-menu-item
> dr-menu-item-hover rich-menu-item rich-
> menu-item-hover  ';;    $('j_id6:j_id14').style.cssText='; ; ;';
> $('j_id6:j_id14:icon').className='dr-menu
> -icon dr-menu-icon-selected rich-menu-item-icon
> rich-menu-item-icon-selected ';    Element.addClassName($('j_
> id6:j_id14:anchor'), 'rich-menu-item-label-selected');"
> onmouseup="Event.stop(event); " style="; "><span clas
> s="dr-menu-icon rich-menu-item-icon  " id="j_id6:j_id14:icon"><img
> height="16" src="/myapp/a4j_3_2_0.SR1-SN
> APSHOTimages/spacer.gif.seam" width="16" /></span><span
> class="rich-menu-item-label " id="j_id6:j_id14:anchor
> ">Upload File</span>
>
>
>
>
> Regards,
> Roland
>
> _______________________________________________
> WebTest mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest
>

Reply via email to