title: Finding Correct Nested Class For Input - Java - Selenium Webdriver
body: <p>The page I am testing has text boxes for data entry, but they are nested within classes of the same name. How would I go about finding the correct one to know which one to enter the data?</p>
  
  <p>Example code:</p>
  
  <pre><code>&lt;span class="sectionWrapper"
     &lt;div class="lineItem"
        &lt;div class="Name" title="Fire" &lt;/div&gt;
        &lt;div class="itmeLimit"
           &lt;input name="limit"&gt;
        &lt;/div&gt;
     &lt;/div&gt;
     &lt;div class="lineItem"
        &lt;div class="Name" title="Wind" &lt;/div&gt;
        &lt;div class="itmeLimit"
           &lt;input name="limit"&gt;
        &lt;/div&gt;
     &lt;/div&gt;
     &lt;div class="lineItem"
        &lt;div class="Name" title="Hail" &lt;/div&gt;
        &lt;div class="itmeLimit"
           &lt;input name="limit"&gt;
        &lt;/div&gt;
     &lt;/div&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>So basically, I need to enter the values on the input name="limit" field. How would I enter "20,000" for the title Wind?</p>
  
  <p>Here's a snippet of actual code:</p>
  
  <pre><code>&lt;span class="sectionWrapper" sort-order="27"&gt;
       &lt;div class="linItm_tableTopWrap tableTopWrap_ifSubLine"&gt;
       &lt;div class="subLine_tableRowsHeader"&gt;
  &lt;div class="linItm_tableRow subLine_tableRow" sort-order="28"&gt;
  &lt;div class="linItm_visibleRow visibleRow_ifSubLine"&gt;
  &lt;a class="linItm_accordionArrow subLine" href="#" style="display: none;"/&gt;
  &lt;a class="remove removeLineItem" style="visibility: hidden" name="A. Dwelling - Fire" href="#"/&gt;
  &lt;div class="linItm_lineItemName" title="A. Dwelling - Fire"&gt;A. Dwelling - Fire&lt;/div&gt;
  &lt;div class="linItm_date"&gt;08/25/2015&lt;/div&gt;
  &lt;div class="linItm_limit_wrap"&gt;
  &lt;div class="linItm_limit_dollarInput"&gt;
  &lt;input class="currencyInput contentRow_amountInput resetPremiums limitInput maxMin" type="text" style="text-align:right" value="0.00" name="limit"/&gt;
  &lt;div class="inputDollarSign"&gt;$&lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="linItm_deductible_wrap"&gt;
  &lt;div class="linItm_proRataPremium_wrap contentRow_rataPremium black"&gt;
  &lt;div class="linItm_annualPremium_wrap black"&gt;
  &lt;input class="linItm_manualCheckbox" type="checkbox" name="manual"/&gt;
  &lt;a class="view" href="#" style="display: none;"/&gt;
  &lt;/div&gt;
  &lt;div class="linItm_accordionRow accordionRow_ifSubLine" style="height: 0px;"/&gt;
  &lt;/div&gt;
       &lt;div class="linItm_tableRow subLine_tableRow" sort-order="29"&gt;
       &lt;div class="linItm_tableRow subLine_tableRow" sort-order="30"&gt;
       &lt;div class="linItm_tableRow subLine_tableRow" sort-order="31"&gt;
       &lt;div class="linItm_tableRow subLine_tableRow" sort-order="32"&gt;
       &lt;div class="linItm_tableRow subLine_tableRow" sort-order="33"&gt;
       &lt;div class="linItm_tableRow subLine_tableRow" sort-order="34"&gt;
       &lt;div class="linItm_tableRow subLine_tableRow" sort-order="36"&gt;
       &lt;div class="linItm_tableRow subLine_tableRow" sort-order="37"&gt;
       &lt;div class="visibleRow_ifSubLine_bottomArea"/&gt;
  &lt;/span&gt;
  </code></pre>