Selecting row from Table - Java Selenium
<p>I have a quick Java table-question. I have a table, containing 4 columns, and X rows. The column's are as follows: Quote Number, Name, Date, and an Add button.
I'm trying to, after looking for a specific name in the table, click on the add-button on the row the name was found.</p>

<p>Example:</p>

<pre><code>Quote#  Name       Date        Add-Button

100001  John Doe1  01/01/1980  [Add]
100002  John Doe2  01/01/1981  [Add]
100003  John Doe3  01/01/1982  [Add]
100004  John Doe4  01/01/1983  [Add]
</code></pre>

<p>I've written the following code, to identify if a certain name is in the table:</p>

<pre><code>public List&lt;String&gt; getInternetQuoteNames()
    {
        List&lt;WebElement&gt; webName = sh.getElements(newInternetQuotesNames);
        List&lt;String&gt; stringName = new ArrayList&lt;&gt;();
        for(WebElement name : webName)
            stringName.add(name.getText());
        return stringName;
    }
</code></pre>

<p>And am now trying to write another method that clicks on the correct [Add]-button, but I'm not sure how to access the correct row as I'm not good with tables. What I wrote so far is:</p>

<pre><code>public void addInternetQuoteByName(String name)
    {
        List&lt;String&gt; listOfNames = getInternetQuoteNames();
        if(listOfNames.contains(name))
        {
            // Find row of provided name
           // Click on [Add]-button on that row
        }
    }
</code></pre>

<p>The HTML code for the Table is as follows:</p>

<pre><code>&lt;tbody&gt;
    &lt;tr&gt;
        &lt;td&gt;100040365822&lt;/td&gt;
        &lt;td&gt;Test06232016 Test033929&lt;/td&gt;
        &lt;td&gt;06/23/2016&lt;/td&gt;
        &lt;td&gt;
            &lt;a id="assignQuoteLink_100040365822" class="add_from_pqs" href="#"&gt;Add Quote&lt;/a&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr class="alt"&gt;
        &lt;td&gt;100040365772&lt;/td&gt;
        &lt;td&gt;Test06232016 Test033723&lt;/td&gt;
        &lt;td&gt;06/23/2016&lt;/td&gt;
        &lt;td&gt;
            &lt;a id="assignQuoteLink_100040365772" class="add_from_pqs" href="#"&gt;Add Quote&lt;/a&gt;
        &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
        &lt;tr class="alt"&gt;
            &lt;tr&gt;
                &lt;tr class="alt"&gt;
&lt;/tbody&gt;
</code></pre>

<p>Any tips on how to complete the method and click on the right row's [Add]-button is greatly appreciated! </p>