[Webtest] Javascript buttons

Lisa Crispin webtest@lists.canoo.com
Fri, 19 Nov 2004 18:37:14 +0000


--NextPart_Webmail_9m3u9jl4l_14107_1100889434_0
Content-Type: text/plain
Content-Transfer-Encoding: 8bit

Hi Marc,
We had considered that, but I ran the html through a validator and it did not complain about not having a form.  We can see why you would say this, though.  

I still have a question however:  If the form is required, then why does it work using htmlid and no form?
Thanks (as always for your wonderful help!)
Lisa


-------------- Original message from Marc Guillemot <mguillemot@yahoo.fr>: -------------- 


> Hi Lisa, 
> 
> your html page is not valid: the input should be surrounded by a form. After 
> having fixed that, everything works right 
> for me. 
> 
> NB: the kind of simple example you sent was exactly right: as small as possible 
> to allow someone else to test it without 
> first having to understand some private business logic. 
> 
> Marc. 
> 
> 
> Lisa Crispin wrote: 
> > Hi Marc, 
> > When we did further testing using our little sample page, we found that 
> > clickbutton using htmlid would work, but not using label or name. We 
> > don't use htmlid up to now, but we can add it to work around this 
> > problem. However, it looks like a bug to me that clickbutton with name 
> > or label doesn't work in this case. Here is the HTML (the button just 
> > goes to www.yahoo.com , which gets an error itself 
> > when WebTest gets to it, but we're not debugging Yahoo's problems!) 
> > 
> > 
> > 
> > 
> > 
> > 
> >  
> > 
> > 
> > 
> > Here is my WebTest code (is this what you need?) I have 3 clickbuttons, 
> > uncomment each one and try. One works (with htmlid) and the other two 
> > get 'No button found'. 
> > 
> > 
> > > > url="/javascript_test/test3.html"/> 
> > 
> > > > text="This is Canoo Test 3"/> 
> > 
> > 
> > 
> > 
> > > > name="testButtonName" /> 
> > 
> > 
> > 
> > 
> > 
> > Thanks, 
> > Lisa 
> > 
> > 
> > 
> > -------------- Original message from Marc Guillemot 
> > : -------------- 
> > 
> > 
> > > Lisa, 
> > > 
> > > current version support javascript buttons and some tests are 
> > contained in the 
> > > selftests. Can you provide a minimal 
> > > (always the same thing) sample of the problem? 
> > > 
> > > Marc. 
> > > 
> > > Lisa Crispin wrote: 
> > > > Using build 560, clickbutton can't find the button if it is a 
> > Javascript 
> > > > button (this didn't work with the HTTPUnit WebTest either). 
> > Here's an 
> > > > example: 
> > > > 
> > > > type="button" value="Review" onclick="javascript: location.href = 
> > > > '/plan/reviewCompensation.vm';"> 
> > > > 
> > > > Does the HtmlUnit-based WebTest support Javascript buttons? 
> > > > Thank you, 
> > > > Lisa 
> > > > 
> > > 
> > > _______________________________________________ 
> > > WebTest mailing list 
> > > WebTest@lists.canoo.com 
> > > http://lists.canoo.com/mailman/listinfo/webtest 
> > 
> 
> _______________________________________________ 
> WebTest mailing list 
> WebTest@lists.canoo.com 
> http://lists.canoo.com/mailman/listinfo/webtest 
--NextPart_Webmail_9m3u9jl4l_14107_1100889434_0
Content-Type: text/html
Content-Transfer-Encoding: 8bit

<html>
<!-- BEGIN WEBMAIL STATIONERY -->
<head></head>
<body>
<!-- WEBMAIL STATIONERY noneset -->
<DIV></DIV>
<DIV>Hi Marc,</DIV>
<DIV>We had considered that, but I ran the html through a validator and it did not complain about not having a form.&nbsp; We can see why you would say this, though.&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>I still have a question however:&nbsp; If the form is required, then why does it work using htmlid and no form?</DIV>
<DIV>Thanks (as always for your wonderful help!)</DIV>
<DIV>Lisa</DIV><BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">-------------- Original message from Marc Guillemot &lt;mguillemot@yahoo.fr&gt;: -------------- <BR><BR><BR>&gt; Hi Lisa, <BR>&gt; <BR>&gt; your html page is not valid: the input should be surrounded by a form. After <BR>&gt; having fixed that, everything works right <BR>&gt; for me. <BR>&gt; <BR>&gt; NB: the kind of simple example you sent was exactly right: as small as possible <BR>&gt; to allow someone else to test it without <BR>&gt; first having to understand some private business logic. <BR>&gt; <BR>&gt; Marc. <BR>&gt; <BR>&gt; <BR>&gt; Lisa Crispin wrote: <BR>&gt; &gt; Hi Marc, <BR>&gt; &gt; When we did further testing using our little sample page, we found that <BR>&gt; &gt; clickbutton using htmlid would work, but not using label or name. We <BR>&gt; &gt; don't use htmlid up to now, but we can add it to work around this <BR>&gt; &gt; problem. However, it looks like a bug to me that clickbutton with name <BR>&gt; &gt; or label doesn't work in this case. Here is the HTML (the button just <BR>&gt; &gt; goes to www.yahoo.com <HTTP: www.yahoo.com>, which gets an error itself <BR>&gt; &gt; when WebTest gets to it, but we're not debugging Yahoo's problems!) <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <INPUT onclick="javascript: &#13;&#10;<BR>> > location.href = 'http://www.yahoo.com';" type=button value="Goto Yahoo"> <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; Here is my WebTest code (is this what you need?) I have 3 clickbuttons, <BR>&gt; &gt; uncomment each one and try. One works (with htmlid) and the other two <BR>&gt; &gt; get 'No button found'. <BR>&gt; &gt; <BR>&gt; &gt; <STEPS><BR>&gt; &gt; <INVOKE <BR stepid="get page">&gt; &gt; url="/javascript_test/test3.html"/&gt; <BR>&gt; &gt; <BR>&gt; &gt; <VERIFYTITLE <BR stepid="verify page">&gt; &gt; text="This is Canoo Test 3"/&gt; <BR>&gt; &gt; <!--  clickbutton using htmlid works - the button is clicked (the 
<BR>> > resulting page, Yahoo home page, causes a different error) --><BR>&gt; &gt; <!--  <clickbutton stepid="click the javascript button by id"
<BR>> >              htmlid="testButtonId"  />        --><BR>&gt; &gt; <BR>&gt; &gt; <!-- Click button using name or label gets a 'No button found' error' --><BR>&gt; &gt; <CLICKBUTTON <BR stepid="click the javascript button by name">&gt; &gt; name="testButtonName" /&gt; <BR>&gt; &gt; <BR>&gt; &gt; <!--        <clickbutton stepid="click the javascript button by label"
<BR>> >              label="GoTo Yahoo"  />  --><BR>&gt; &gt; <BR>&gt; &gt; </STEPS><BR>&gt; &gt; <BR>&gt; &gt; Thanks, <BR>&gt; &gt; Lisa <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; -------------- Original message from Marc Guillemot <BR>&gt; &gt; <MGUILLEMOT@YAHOO.FR>: -------------- <BR>&gt; &gt; <BR>&gt; &gt; <BR>&gt; &gt; &gt; Lisa, <BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; current version support javascript buttons and some tests are <BR>&gt; &gt; contained in the <BR>&gt; &gt; &gt; selftests. Can you provide a minimal <BR>&gt; &gt; &gt; (always the same thing) sample of the problem? <BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; Marc. <BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; Lisa Crispin wrote: <BR>&gt; &gt; &gt; &gt; Using build 560, clickbutton can't find the button if it is a <BR>&gt; &gt; Javascript <BR>&gt; &gt; &gt; &gt; button (this didn't work with the HTTPUnit WebTest either). <BR>&gt; &gt; Here's an <BR>&gt; &gt; &gt; &gt; example: <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; type="button" value="Review" onclick="javascript: location.href = <BR>&gt; &gt; &gt; &gt; '/plan/reviewCompensation.vm';"&gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; Does the HtmlUnit-based WebTest support Javascript buttons? <BR>&gt; &gt; &gt; &gt; Thank you, <BR>&gt; &gt; &gt; &gt; Lisa <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; _______________________________________________ <BR>&gt; &gt; &gt; WebTest mailing list <BR>&gt; &gt; &gt; WebTest@lists.canoo.com <BR>&gt; &gt; &gt; http://lists.canoo.com/mailman/listinfo/webtest <BR>&gt; &gt; <BR>&gt; <BR>&gt; _______________________________________________ <BR>&gt; WebTest mailing list <BR>&gt; WebTest@lists.canoo.com <BR>&gt; http://lists.canoo.com/mailman/listinfo/webtest </BLOCKQUOTE>
<!-- END WEBMAIL STATIONERY -->

</body>
</html>

--NextPart_Webmail_9m3u9jl4l_14107_1100889434_0--