[Webtest] Clickbutton with index not working

Lisa Crispin webtest@lists.canoo.com
Tue, 16 Nov 2004 20:52:57 +0000


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

Great!  Thank you, Marc!
-- Lisa


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


> Hi Lisa, 
> 
> if the server does it works, next build should allow to specify a button to 
> click using its id. 
> 
> Marc. 
> 
> Lisa Crispin wrote: 
> > 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 
> > : -------------- 
> > 
> > 
> > > 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 
> > 
> 
> _______________________________________________ 
> WebTest mailing list 
> WebTest@lists.canoo.com 
> http://lists.canoo.com/mailman/listinfo/webtest 
--NextPart_Webmail_9m3u9jl4l_29986_1100638377_0
Content-Type: text/html
Content-Transfer-Encoding: 8bit

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