title: How to get value from page using WebDriver >> find elements
body: <p>How to get value from  hierarchy with Selenium WebDriver and WebElement?
  The web page application is Telerik model.</p>
  
  <p>Part of my <strong>java code</strong>:</p>
  
  <pre class="lang-java prettyprint-override"><code>public void ChangeElementSaveAndVerify() throws InterruptedException
      {                       
          driver.findElement(By.xpath(myPrinterTab.printerTabIconLeftPane)).click();
          Thread.sleep(5000);     
          driver.findElement(By.xpath(myPrinterTab.showHideDriverDetailed)).click();
  
          Thread.sleep(5000);
          WebElement select = driver.findElement(By.id("ctl00_ContentPlaceHolder2_RadGrid_Driver_ctl00_ctl05_EditFormControl_Preton_ucSettings_Driver_treeList_ctl04_Enabled_DropDown"));
  
              WebElement innerElemt = select.findElement(By.tagName("div"));
              WebElement innerElemt2 = innerElemt.findElement(By.tagName("ul"));
              List&lt;WebElement&gt; allOptions = innerElemt2.findElements(By.tagName("li"));
  
              for (WebElement option : allOptions) {
  
                  System.out.println("Value is: "+ option.getText());
                  System.out.println(option.getAttribute("value"));
                  driver.findElement(By.xpath(myPrinterTab.arrowUsePreton)).click();
                  Thread.sleep(5000);
                  option.click();
                  Thread.sleep(5000);
                  driver.findElement(By.xpath(myPrinterTab.saveButton)).click();
  
              }
  </code></pre>
  
  <p><strong>Page Source</strong></p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="rcbSlide" style="z-index: 6000; visibility: visible; display: block; overflow: visible; margin-left: 0px; position: absolute; top: 328px; left: 1122.5px; height: 42px; width: 370px;"&gt;
      &lt;div id="ctl00_ContentPlaceHolder2_RadGrid_Driver_ctl00_ctl05_EditFormControl_Preton_ucSettings_Driver_treeList_ctl08_GraphicMode_DropDown" class="RadComboBoxDropDown RadComboBoxDropDown_Default " style="display: block; visibility: visible; top: 0px; left: 0px; width: 368px;"&gt;
          &lt;div class="rcbScroll rcbWidth" style="width: 100%; overflow: auto; height: 40px;"&gt;
              &lt;ul class="rcbList" style="list-style:none;margin:0;padding:0;zoom:1;"&gt;
                  &lt;li class="rcbItem "&gt; … &lt;/li&gt;
                  &lt;li class="rcbHovered "&gt; … &lt;/li&gt;
              &lt;/ul&gt;
           &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>