title: how to find search results using selenium webdriver
body: <p>I am setting up a test to perform a search and after the search is complete, i want to     capture the results line that says "About xxx results (x.xx seconds)".  I can get this to     work using the firefox webdriver, but it does not work when I use IE or Chrome driver.  I     need help determining what is wrong with my code.  Here is the code snippet:</p>
  
  <pre><code>public void runSearch(WebDriver driver) {
  
      WebElement element = driver.findElement(By.name("search"));
      element.sendKeys("Kearney");
      element.sendKeys(Keys.RETURN);
      String itext = driver.findElement( By.cssSelector("div#resInfo-0")).getText();
      System.out.println("Search returned '" + itext + "'.");
  }
  </code></pre>
  
  <p>Here is the html of my page after the search has been made:</p>
  
  <p></p>
  
  <p></p>
  
  <pre><code>&lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
      &lt;header id="main_header_iphone"&gt;&lt;/header&gt;
      &lt;div class="clear"&gt;&lt;/div&gt;
      &lt;header id="main-header"&gt;&lt;/header&gt;
      &lt;section&gt;
          &lt;div class="content_nn"&gt;
              &lt;div class="subnav"&gt;
                  &lt;!--
  
                  &lt;div class="bannerBox"&gt;
                   &lt;div class="btn_events"&gt;&lt;…
  
                  --&gt;
                  &lt;div class="logo"&gt;&lt;/div&gt;
                  &lt;!--
  
                  START Search
  
                  --&gt;
                  &lt;div class="search_container"&gt;
                      &lt;div id="cse" style="width:100%;"&gt;
                          &lt;div class="gsc-control-cse gsc-control-cse-en"&gt;
                              &lt;div class="gsc-control-wrapper-cse" dir="ltr"&gt;
                                  &lt;form class="gsc-search-box" accept-charset="utf-8"&gt;&lt;/form&gt;
                                  &lt;div class="gsc-results-wrapper-nooverlay gsc-results-wrapper-visible"&gt;
                                      &lt;div class="gsc-tabsAreaInvisible"&gt;&lt;/div&gt;
                                      &lt;div class="gsc-tabsAreaInvisible"&gt;&lt;/div&gt;
                                      &lt;div class="gsc-above-wrapper-area"&gt;
                                          &lt;table class="gsc-above-wrapper-area-container" cellspacing="0" cellpadding="0"&gt;
                                              &lt;tbody&gt;
                                                  &lt;tr&gt;
                                                      &lt;td class="gsc-result-info-container"&gt;
                                                          &lt;div id="resInfo-0" class="gsc-result-info"&gt;
  
                                                              About 31 results (0.11 seconds)
  
                                                          &lt;/div&gt;
                                                      &lt;/td&gt;
                                                  &lt;/tr&gt;
                                              &lt;/tbody&gt;
                                          &lt;/table&gt;
                                      &lt;/div&gt;
                                      &lt;div class="gsc-adBlockNoHeight" style="height: 0px; font-weight: normal; text-align: center;"&gt;&lt;/div&gt;
                                      &lt;div class="gsc-wrapper"&gt;&lt;/div&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
                      &lt;script type="text/javascript"&gt;&lt;/script&gt;
                      &lt;script type="text/javascript" src="http://www.google.com/uds/?file=search&amp;v=1&amp;hl=en"&gt;&lt;/script&gt;
                      &lt;link rel="stylesheet" type="text/css" href="http://www.google.com/uds/api/search/1.0/65b21018ad4df09e3eb5a21326b72d0b/default+en.css"&gt;&lt;/link&gt;
                      &lt;script type="text/javascript" src="http://www.google.com/uds/api/search/1.0/65b21018ad4df09e3eb5a21326b72d0b/default+en.I.js"&gt;&lt;/script&gt;
                      &lt;!--
  
                      END Search
  
                      --&gt;
                  &lt;/div&gt;
                  &lt;div class="text_rural_h2" style="float:left; width:100%"&gt;&lt;/div&gt;
                  &lt;div class="index_page_heading" style="float:left;"&gt;&lt;/div&gt;
                  &lt;div class="letest_news2" style="float:left;"&gt;&lt;/div&gt;
              &lt;/div&gt;
              &lt;footer id="footer"&gt;&lt;/footer&gt;
          &lt;/div&gt;
      &lt;/section&gt;
      &lt;div id="topcontrol" style="position: fixed; bottom: 25px; right: 10px; opacity: 0; cursor: pointer;" title="Scroll Back to Top"&gt;&lt;/div&gt;
      &lt;table class="gstl_50 gssb_c" cellspacing="0" cellpadding="0" style="width: 137px; display: none; top: 153px; position: absolute; left: 97px;"&gt;&lt;/table&gt;
      &lt;div style="display:none"&gt;&lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>