title: Clicking a button within a specific row
body: <p>I currently have a test that adds an entry to the table below, generating a random location name and value. I'm now trying to click on the edit icon within the table. </p>
  
  <p><a href="https://i.stack.imgur.com/BLReL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BLReL.jpg" alt="Table"></a></p>
  
  <p>I can find the correct location name cell using-</p>
  
  <pre><code>string editButton = "//td[text(),'"+locationName+ "'];
  driver.FindElement(By.XPath(editButton)).Click();
  </code></pre>
  
  <p>But not sure how to click on the Edit button from here?</p>
  
  <p>HTML for the button is-</p>
  
  <pre><code>&lt;tr id="officeRechargeGrid_DXDataRow1" class="dxgvDataRow_Office2010Silver" style=""&gt;
      &lt;td class="dxgvCommandColumn_Office2010Silver dxgv" align="center"&gt;&lt;a class="dxbButton_Office2010Silver dxgvCommandColumnItem_Office2010Silver dxgv__cci dxbButtonSys" data-args="[['StartEdit',1],1]" id="officeRechargeGrid_DXCBtn3" href="javascript:;" style="font-size: 0pt;"&gt;&lt;img title="Edit" class="dx-vam" src="/Images/editgray.png" alt="Edit" style="height:16px;width:16px;" id="officeRechargeGrid_DXCBtn3Img"&gt;&lt;/a&gt;&lt;script id="dxss_1145064087" type="text/javascript" data-executed="true"&gt;
  </code></pre>
  
  <p>HTML for the table is-
      
          
              
                  
                      
      
  
  <pre><code>//--&gt;
  &lt;/script&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;td id="officeRechargeGrid_col2" class="dxgvHeader_Office2010Silver" onmousedown="ASPx.GHeaderMouseDown('officeRechargeGrid', this, event);" style="border-top-width:0px;border-left-width:0px;"&gt;&lt;table style="width:100%;border-collapse:collapse;" cellspacing="0" cellpadding="0"&gt;
              &lt;tbody&gt;&lt;tr&gt;
                  &lt;td&gt;Location&lt;/td&gt;&lt;td style="width:1px;text-align:right;"&gt;&lt;span class="dx-vam"&gt;&amp;nbsp;&lt;/span&gt;&lt;img class="dxGridView_gvHeaderFilter_Office2010Silver dxgv__hfb dx-vam" src="/DXR.axd?r=1_37-Z658g" alt="[Filter]" style="cursor:default;"&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;&lt;td id="officeRechargeGrid_col3" class="dxgvHeader_Office2010Silver" onmousedown="ASPx.GHeaderMouseDown('officeRechargeGrid', this, event);" style="border-top-width:0px;border-left-width:0px;border-right-width:0px;"&gt;&lt;table style="width:100%;border-collapse:collapse;" cellspacing="0" cellpadding="0"&gt;
              &lt;tbody&gt;&lt;tr&gt;
                  &lt;td&gt;Assumed Volume&lt;/td&gt;&lt;td style="width:1px;text-align:right;"&gt;&lt;span class="dx-vam"&gt;&amp;nbsp;&lt;/span&gt;&lt;img class="dxGridView_gvHeaderFilter_Office2010Silver dxgv__hfb dx-vam" src="/DXR.axd?r=1_37-Z658g" alt="[Filter]" style="cursor:default;"&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;&lt;/table&gt;&lt;/td&gt;
      &lt;/tr&gt;&lt;tr id="officeRechargeGrid_DXFilterRow" class="dxgvFilterRow_Office2010Silver"&gt;
          &lt;td class="dxgvCommandColumn_Office2010Silver dxgv" align="center"&gt;&amp;nbsp;&lt;/td&gt;&lt;td class="dxgv"&gt;&lt;table class="dxeTextBoxSys dxeTextBox_Office2010Silver dxeTextBoxDefaultWidthSys" id="officeRechargeGrid_DXFREditorcol2" style="width:100%;border-collapse:collapse;" cellspacing="0" cellpadding="0"&gt;
              &lt;tbody&gt;&lt;tr&gt;
                  &lt;td class="dxic" style="width:100%;"&gt;&lt;input class="dxeEditArea_Office2010Silver dxeEditAreaSys" id="officeRechargeGrid_DXFREditorcol2_I" name="officeRechargeGrid$DXFREditorcol2" onfocus="ASPx.EGotFocus('officeRechargeGrid_DXFREditorcol2')" onblur="ASPx.ELostFocus('officeRechargeGrid_DXFREditorcol2')" onchange="ASPx.EValueChanged('officeRechargeGrid_DXFREditorcol2')" type="text"&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;&lt;/table&gt;&lt;script id="dxss_334903315" type="text/javascript" data-executed="true"&gt;
  &lt;!--
  ASPx.AddDisabledItems('officeRechargeGrid_DXFREditorcol2',[[['dxeDisabled_Office2010Silver'],[''],['','I']]]);
  
  var dxo = new ASPxClientTextBox('officeRechargeGrid_DXFREditorcol2');
  dxo.InitGlobalVariable('officeRechargeGrid_DXFREditorcol2');
  dxo.uniqueID = 'officeRechargeGrid$DXFREditorcol2';
  dxo.ValueChanged.AddHandler(function(s, event) { ASPx.GVFilterChanged('officeRechargeGrid',s); });
  dxo.KeyDown.AddHandler(function(s, event) { ASPx.GVFilterKeyPress('officeRechargeGrid',s,event); });
  dxo.RequireStyleDecoration();
  dxo.styleDecoration.AddStyle('F','dxeFocused_Office2010Silver','');
  dxo.AfterCreate();
  
  //--&gt;
  &lt;/script&gt;&lt;/td&gt;&lt;td class="dxgv" style="text-align:Right;border-right-width:0px;"&gt;&lt;table class="dxeTextBoxSys dxeTextBox_Office2010Silver dxeTextBoxDefaultWidthSys" id="officeRechargeGrid_DXFREditorcol3" style="width:100%;border-collapse:collapse;" cellspacing="0" cellpadding="0"&gt;
              &lt;tbody&gt;&lt;tr&gt;
                  &lt;td class="dxic" style="width:100%;"&gt;&lt;input class="dxeEditArea_Office2010Silver dxeEditAreaSys" id="officeRechargeGrid_DXFREditorcol3_I" name="officeRechargeGrid$DXFREditorcol3" onfocus="ASPx.EGotFocus('officeRechargeGrid_DXFREditorcol3')" onblur="ASPx.ELostFocus('officeRechargeGrid_DXFREditorcol3')" onchange="ASPx.EValueChanged('officeRechargeGrid_DXFREditorcol3')" type="text"&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;&lt;/table&gt;&lt;script id="dxss_1037231823" type="text/javascript" data-executed="true"&gt;
  &lt;!--
  ASPx.AddDisabledItems('officeRechargeGrid_DXFREditorcol3',[[['dxeDisabled_Office2010Silver'],[''],['','I']]]);
  
  var dxo = new ASPxClientTextBox('officeRechargeGrid_DXFREditorcol3');
  dxo.InitGlobalVariable('officeRechargeGrid_DXFREditorcol3');
  dxo.uniqueID = 'officeRechargeGrid$DXFREditorcol3';
  dxo.ValueChanged.AddHandler(function(s, event) { ASPx.GVFilterChanged('officeRechargeGrid',s); });
  dxo.KeyDown.AddHandler(function(s, event) { ASPx.GVFilterKeyPress('officeRechargeGrid',s,event); });
  dxo.RequireStyleDecoration();
  dxo.styleDecoration.AddStyle('F','dxeFocused_Office2010Silver','');
  dxo.AfterCreate();
  
  //--&gt;
  &lt;/script&gt;&lt;/td&gt;
      &lt;/tr&gt;&lt;tr id="officeRechargeGrid_DXDataRow0" class="dxgvDataRow_Office2010Silver" style=""&gt;
          &lt;td class="dxgvCommandColumn_Office2010Silver dxgv" align="center"&gt;&lt;a class="dxbButton_Office2010Silver dxgvCommandColumnItem_Office2010Silver dxgv__cci dxbButtonSys" data-args="[['StartEdit',0],1]" id="officeRechargeGrid_DXCBtn1" href="javascript:;" style="font-size: 0pt;"&gt;&lt;img title="Edit" class="dx-vam" src="/Images/editgray.png" alt="Edit" style="height:16px;width:16px;" id="officeRechargeGrid_DXCBtn1Img"&gt;&lt;/a&gt;&lt;script id="dxss_1182543207" type="text/javascript" data-executed="true"&gt;
  &lt;!--
  ASPx.AddDisabledItems('officeRechargeGrid_DXCBtn1',[[['dxbDisabled_Office2010Silver'],[''],[''],['','TC']]]);
  
  //--&gt;
  &lt;/script&gt;&lt;a class="dxbButton_Office2010Silver dxgvCommandColumnItem_Office2010Silver dxgv__cci dxbButtonSys" data-args="[['Delete',0],1]" id="officeRechargeGrid_DXCBtn2" href="javascript:;" style="font-size: 0pt;"&gt;&lt;img title="Delete" class="dx-vam" src="/Images/delete.png" alt="Delete" style="height:16px;width:16px;" id="officeRechargeGrid_DXCBtn2Img"&gt;&lt;/a&gt;&lt;script id="dxss_2131039704" type="text/javascript" data-executed="true"&gt;
  &lt;!--
  ASPx.AddDisabledItems('officeRechargeGrid_DXCBtn2',[[['dxbDisabled_Office2010Silver'],[''],[''],['','TC']]]);
  
  //--&gt;
  &lt;/script&gt;&lt;/td&gt;&lt;td class="dxgv"&gt;TAHPOYOWAG&lt;/td&gt;&lt;td class="dxgv" style="border-right-width:0px;" align="right"&gt;49,554.00&lt;/td&gt;
      &lt;/tr&gt;&lt;tr id="officeRechargeGrid_DXDataRow1" class="dxgvDataRow_Office2010Silver dxgvLVR" style=""&gt;
          &lt;td class="dxgvCommandColumn_Office2010Silver dxgv" style="border-bottom-width:0px;" align="center"&gt;&lt;a class="dxbButton_Office2010Silver dxgvCommandColumnItem_Office2010Silver dxgv__cci dxbButtonSys" data-args="[['StartEdit',1],1]" id="officeRechargeGrid_DXCBtn3" href="javascript:;" style="font-size: 0pt;"&gt;&lt;img title="Edit" class="dx-vam" src="/Images/editgray.png" alt="Edit" style="height:16px;width:16px;" id="officeRechargeGrid_DXCBtn3Img"&gt;&lt;/a&gt;&lt;script id="dxss_1145064087" type="text/javascript" data-executed="true"&gt;
  &lt;!--
  ASPx.AddDisabledItems('officeRechargeGrid_DXCBtn3',[[['dxbDisabled_Office2010Silver'],[''],[''],['','TC']]]);
  
  //--&gt;
  &lt;/script&gt;&lt;a class="dxbButton_Office2010Silver dxgvCommandColumnItem_Office2010Silver dxgv__cci dxbButtonSys" data-args="[['Delete',1],1]" id="officeRechargeGrid_DXCBtn4" href="javascript:;" style="font-size: 0pt;"&gt;&lt;img title="Delete" class="dx-vam" src="/Images/delete.png" alt="Delete" style="height:16px;width:16px;" id="officeRechargeGrid_DXCBtn4Img"&gt;&lt;/a&gt;&lt;script id="dxss_511888854" type="text/javascript" data-executed="true"&gt;
  &lt;!--
  ASPx.AddDisabledItems('officeRechargeGrid_DXCBtn4',[[['dxbDisabled_Office2010Silver'],[''],[''],['','TC']]]);
  
  //--&gt;
  &lt;/script&gt;&lt;/td&gt;&lt;td class="dxgv" style="border-bottom-width:0px;"&gt;JKFZICCPJA&lt;/td&gt;&lt;td class="dxgv" style="border-right-width:0px;border-bottom-width:0px;" align="right"&gt;76,646.00&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;
  </code></pre>