java - click on Button based on Text contain in multiple Rows -


i need perform following scenario: there form data entered in multiple rows , every record has own button , need click on specific record based on email address.

html source:

<div id="daily-sales-graph">   <table class="graph" align="center">     <tbody>       <tr>         <th style="width: 25px;"></th>         <th style="width: 170px;">           <h2 align="center" style="white-space: nowrap">&nbsp;order number</h2>         </th>         <th style="width: 60px;">           <h2 align="center">&nbsp;amount</h2>         </th>         <th style="width: 100px;">           <h2 align="center" style="white-space: nowrap">&nbsp;order date</h2>         </th>         <th>           <h2 align="center" style="white-space: nowrap">&nbsp;last called</h2>         </th>         <th>           <h2 align="center" style="white-space: nowrap">&nbsp;security code</h2>         </th>         <th>           <h2 align="center" style="white-space: nowrap">&nbsp;customer's email address</h2>         </th>         <th style="width: 74px;"></th>       </tr>        <tr class="rowhighlight">         <td style="font:12px arial,sans-serif;background-color: maroon; color:white;"></td>         <td>ord2014236247112436</td>         <td>$30.00</td>         <td>23-jun-2014</td>         <td>23-jun-2014</td>         <td>5865</td>         <td>uatmigrationcust@mailinator.com</td>         <td>           <input type="button" value="open" name="orddetails" class="button" disabled="&quot;disabled&quot;" onclick="openwind('/crmprocessing/new-order-detail-ns2?customerid=20311&amp;ordid=41203&amp;affiliateid=2041')">         </td>       </tr> 

this i've tried far, selects first record only.

driver.get("http://domain.com/"); driver.findelement(by.id("username")).clear(); driver.findelement(by.id("username")).sendkeys("dinero"); driver.findelement(by.id("password")).clear(); driver.findelement(by.id("password")).sendkeys("password"); driver.findelement(by.cssselector("input[type=\"submit\"]")).click();  //new select(driver.findelement(by.id("dpapplication"))).selectbyvisibletext("cheapcallingcards"); driver.get("http://ccadmin.dinerotesting.com/crmprocessing/new-customer-orders-ns2"); driver.findelement(by.xpath("//*[@id='daily-sales-graph']/table/tbody/td[2]/td[8]/input")).click(); 

my advice kind of things use css selector nth-child() function.

there's jsfiddle basic exemple.

you have change value of nth-child(**i**)  

Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -