janicita 0 Newbie Poster

Hi,

I,m using clickAndWait to click on a button. But I got an error that
says the button was not found. I guess this is because there is more than one button at the same level of the html code.

selenium.clickAndWait("//input[@value='Réserver']");

The number of buttons is generated dynamically and the onclick value is different for each of the buttons.

<b>12 500 milles</b>/chambre/nuit</div>
<div class="order">
<input type="button" value="R&eacute;server" onmouseover="if (this.disabled != 'true') this.className = 'action-button-hover';" onmouseout="if (this.disabled != 'true') this.className = 'action-button';" class="action-button" onclick="submitHotel('CA','Direct','SI','VO','271','12500','12500', 'BookThis');return false;">
</div>
</div>
</div>
<div class="detail">

<div class="images">
<center>
<img width="125" onclick="submitHotel('CA','Direct','SI','VO','271','12500','12500', 'Details');return false;" src="http://localhost:8086/static/gfx/hotel/VO/she271lo.46594_md.jpg"><br>
<img onclick="submitHotel('CA','Direct','SI','VO','271','12500','12500', 'Details');return false;" src="http://localhost:8086/static/gfx/hotel/SI/logo.gif"></center>
</div>
<div class="description">
<b>Sheraton Centre Toronto Hotel</b>
<br>
<br>S'&eacute;talant sur 10 hectares de cascades, de jardins et de terrasses pittoresques, le remarquable Sheraton Centre Toronto Hotel, class&eacute; Quatre Diamants par la CAA/AAA, est une v&eacute;ritable oasis de fra&icirc;cheur parmi les h&ocirc;tels du centre de Toronto. Superbement situ&eacute; au cœur du quartier des th&eacute;&acirc;tres et des lieux de divertissement de la ville, nous sommes &agrave; deux pas du centre commercial Eaton et des...<br>

<br>
<a class="arrow-double" href="" onclick="submitHotel('CA','Direct','SI','VO','271','12500','12500', 'Details');return false;">Voir d&eacute;tails</a>
</div>
</div>
</div>
<br>
<div>
<div class="summary">
<div class="address">
<b>The Fairmont Royal York</b>
<br>100 Front Street West<br>Toronto&nbsp;ON<br>M5J 1E3,&nbsp;Canada</div>

<div class="distance-rooms">A&eacute;roport : 21 km<br>Nombre de chambres : 1 365</div>
<div class="cost">
<div class="rate">Co&ucirc;t minimum<br>
<b>27 500 milles</b>/chambre/nuit</div>
<div class="order">
<input type="button" value="R&eacute;server" onmouseover="if (this.disabled != 'true') this.className = 'action-button-hover';" onmouseout="if (this.disabled != 'true') this.className = 'action-button';" class="action-button" onclick="submitHotel('CA','Direct','FA','FA','RYH','27500','39000', 'BookThis');return false;">
</div>
</div>


how can I get the first button?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.