Seda
Seda

Reputation: 37

watir webdriver unable to click button in the table

<tr class="even_row">
    <td colspan="1" rowspan="1">
        <button type="button" onclick="doSubmit('_eventId_addToHouseholdFromOther')">
            <span>
                <i class="icon-arrow-left"></i>
            </span>
        </button>
    </td>
    <td colspan="1" rowspan="1"> … </td>
    <td colspan="1" rowspan="1"> … </td>
    <td colspan="1" rowspan="1"> … </td>
</tr>

Does anybody know, how I can click on this button using watir webdriver?

Upvotes: 0

Views: 255

Answers (1)

Justin Ko
Justin Ko

Reputation: 46836

Assuming that the <i class="icon-arrow-left"> element is unique (ie no other i element with the same class exists), you can do:

browser.i(:class => 'icon-arrow-left').click

Upvotes: 2

Related Questions