title: Unable to read text from textbox using gettext() of selenium webdriver?
body: <p>I can't read dates from ajax calendar control after date selection </p>
  
  <p><a href="http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Calendar/Calendar.aspx" rel="noreferrer">http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Calendar/Calendar.aspx</a></p>
  
  <p>I don't get any error but I can't fetch any value from textbox.</p>
  
  <pre><code>public static void main(String[] args) throws InterruptedException {
  
          WebDriver driver = new FirefoxDriver();
          driver.get("http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/Calendar/Calendar.aspx");
          driver.manage().window().maximize();
  
  
          //Default calendar: 
          driver.findElement(By.xpath("//*[@id='ctl00_SampleContent_Date1']")).click();
  
          for(int i=0;i&lt;=5;i++){
  
              for(int j = 0;j&lt;=6;j++){
  
                  System.out.print(driver.findElement(By.xpath("//*[@id='ctl00_SampleContent_defaultCalendarExtender_day_"+i+"_"+j+"']")).getText()+"-");
  
              }
              System.out.println();
          }
  
          driver.findElement(By.xpath("//*[@id='ctl00_SampleContent_defaultCalendarExtender_day_3_4']")).click();
  
          System.out.println(driver.findElement(By.xpath("//*[@id='ctl00_SampleContent_Date1']")).getText());
  
  
          //Calendar with an associated button:
  
          System.out.println("Calendar with an associated button:------------------------------------------------------");
  
          driver.findElement(By.xpath("//*[@id='ctl00_SampleContent_Image1']")).click();
  
          for(int i=0;i&lt;=5;i++){
  
              for(int j = 0;j&lt;=6;j++){
  
                  System.out.print(driver.findElement(By.xpath("//*[@id='ctl00_SampleContent_calendarButtonExtender_day_"+i+"_"+j+"']")).getText()+"-");
  
              }
              System.out.println();
          }
  
          Thread.sleep(5000L);
          driver.findElement(By.xpath("//*[@id='ctl00_SampleContent_Image1']")).click();
          driver.findElement(By.xpath("//*[@id='ctl00_SampleContent_calendarButtonExtender_day_3_3']")).click();
  
          System.out.println(driver.findElement(By.xpath("//*[@id='ctl00_SampleContent_Date5']")).getText());
  
  
      }
  </code></pre>