[Webtest] Clickbutton with index not working

Lisa Crispin webtest@lists.canoo.com
Mon, 15 Nov 2004 22:30:08 +0000


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

Hi Marc,
In our legacy code, it's a problem because on some pages there aree multiple buttons same label and no name attribute, so no way to distinguish them.  I was using the index.  I'm working around that now by just using invoke, it's not that huge a deal to me because we're phasing out this old code.

In our new code, although we had discussed how things needed unique names for WebTest to work, a programmer forgot that and produced a page for a review process that had 8 buttons all with the label 'Review' and no unique name.  Actually we had thought we could use id but saw in the WebTest doc that only the text in the value attribute or the value of the name attribute can be used.  So we're changing the HTML to include the name attribute for each button.  I think it's better to do this anyway, so I don't miss the index locator myself.  However, I think people who are stuck with legacy code that has buttons with the same label and no name would still like to have something like that.  If you use 'invoke' and the button actually breaks, you won't ever know.

Thanks,
Lisa



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


> Hi Lisa, 
> 
> I've removed it because it was useless in the selftests. Furthermore I think 
> that it is a bad practice to rely on the 
> order of buttons to write a test: when the designer decide that it now looks 
> nicer to have first button on the right and 
> second button on the left, your test will fail. And an index indication can only 
> rely on the position in the html source 
> code, even if the displayed order looks different. 
> 
> Nevertheless feel free to provide a test where the index locator is really 
> needed. 
> 
> Clickbutton is missing an htmlid attribute to allow perfect identification of 
> the button to click. 
> 
> Marc. 
> 
> Lisa Crispin wrote: 
> > Thanks, Marc. 
> > Is there some feature which took the place of index? What would you do 
> > if you need this functionality? 
> > thanks, 
> > Lisa 
> > 
> > -------------- Original message from Marc Guillemot 
> > : -------------- 
> > 
> > 
> > > Hi Lisa, 
> > > 
> > > yes, index has been removed. The doc is not uptodate, sorry. 
> > > 
> > > Marc. 
> > > 
> > > Lisa Crispin wrote: 
> > > > I'm getting the following error running a script which works in 
> > the 
> > > > HTTPUnit-based WebTest. I'm using build 560. 
> > > > 
> > > > C:\java\eplan\build.xml:901: Following error occured while 
> > executing 
> > > > this line 
> > > > C:\java\eplan\test\WebTest\SmokeTest\EmployeeEnrollTest.xml:23: 
> > The 
> > > > 
> > > > > type doesn't support the nested "index" element. 
> > > > 
> > > > This line number 23 in that file is just the testSpec, but I 
> > think it 
> > > > must actually be complaining about this: 
> > > > 
> > > > 
> > > > label="Search..." > 
> > > > 
> > > > 
> > > > The doc shows this is still supported, has it been deprecated? 
> > I can 
> > > > work around it, but I'm just curious. 
> > > > thanks, 
> > > > 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_3115_1100557808_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>In our legacy code, it's a problem because on some pages there aree multiple buttons&nbsp;same label and no name attribute, so no way to distinguish them.&nbsp; I was using the index.&nbsp;&nbsp;I'm working around that now&nbsp;by just using invoke, it's not that huge a deal to me because we're phasing out this old code.</DIV>
<DIV>&nbsp;</DIV>
<DIV>In our new code, although we had discussed how things needed unique names for WebTest to work, a programmer forgot that and produced a page for a review process that had 8 buttons all with the label 'Review' and no unique name.&nbsp; Actually we had thought we could use id but saw in the WebTest doc that only the text in the value attribute or the value of the name attribute can be used.&nbsp; So we're changing the&nbsp;HTML to include the name attribute for each button.&nbsp; I think it's better to do this anyway, so I don't miss the index locator myself.&nbsp; However, I think people who are stuck with legacy code that has buttons with the same label and no name would still like to have something like that.&nbsp; If you use 'invoke' and the button actually breaks, you won't ever know.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV>Lisa</DIV>
<DIV>&nbsp;</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; I've removed it because it was useless in the selftests. Furthermore I think <BR>&gt; that it is a bad practice to rely on the <BR>&gt; order of buttons to write a test: when the designer decide that it now looks <BR>&gt; nicer to have first button on the right and <BR>&gt; second button on the left, your test will fail. And an index indication can only <BR>&gt; rely on the position in the html source <BR>&gt; code, even if the displayed order looks different. <BR>&gt; <BR>&gt; Nevertheless feel free to provide a test where the index locator is really <BR>&gt; needed. <BR>&gt; <BR>&gt; Clickbutton is missing an htmlid attribute to allow perfect identification of <BR>&gt; the button to click. <BR>&gt; <BR>&gt; Marc. <BR>&gt; <BR>&gt; Lisa Crispin wrote: <BR>&gt; &gt; Thanks, Marc. <BR>&gt; &gt; Is there some feature which took the place of index? What would you do <BR>&gt; &gt; if you need this functionality? <BR>&gt; &gt; thanks, <BR>&gt; &gt; Lisa <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; Hi Lisa, <BR>&gt; &gt; &gt; <BR>&gt; &gt; &gt; yes, index has been removed. The doc is not uptodate, sorry. <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; I'm getting the following error running a script which works in <BR>&gt; &gt; the <BR>&gt; &gt; &gt; &gt; HTTPUnit-based WebTest. I'm using build 560. <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; C:\java\eplan\build.xml:901: Following error occured while <BR>&gt; &gt; executing <BR>&gt; &gt; &gt; &gt; this line <BR>&gt; &gt; &gt; &gt; C:\java\eplan\test\WebTest\SmokeTest\EmployeeEnrollTest.xml:23: <BR>&gt; &gt; The <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; &gt; type doesn't support the nested "index" element. <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; This line number 23 in that file is just the testSpec, but I <BR>&gt; &gt; think it <BR>&gt; &gt; &gt; &gt; must actually be complaining about this: <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; label="Search..." &gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &gt; &gt; The doc shows this is still supported, has it been deprecated? <BR>&gt; &gt; I can <BR>&gt; &gt; &gt; &gt; work around it, but I'm just curious. <BR>&gt; &gt; &gt; &gt; thanks, <BR>&gt; &gt; &gt; &gt; Lisa <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_3115_1100557808_0--