title: Unable to locate an element in Selenium
body: <pre><code>&lt;div id="ColumnMask"&gt;
      &lt;div id="MiddleColumnPositioner"&gt;
          &lt;div id="LeftColumnPositioner"&gt;
              &lt;div id="MiddleColumnWrapper"&gt;
                  &lt;div id="MiddleColumn"&gt;
                      &lt;div class="bdrBottom"&gt;
                          &lt;div class="pad"&gt;
                              &lt;h2&gt;Account Information&lt;/h2&gt;
                              &lt;br/&gt;
                              &lt;div class="padLeft padRight"&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;!-- MiddleColumn --&gt;
                      &lt;/div&gt;
                      &lt;!-- MiddleColumnWrapper --&gt;
  </code></pre>
  
  <p>Hi. I'm trying to locate  tag and surprisingly nothing works. Here are my examples:</p>
  
  <pre><code>public IWebElement AccountInfoTitle() 
  { 
      return Driver.FindElement(By.XPath("//*[@id='MiddleColumn']/div[2]/h2[contains(.,'Account Information')]")); 
  }
  
  public IWebElement AccountInfoTitle() 
  { 
      return Driver.FindElement(By.XPath("//h2 [contains(.,'Account Information')]")); 
  }
  </code></pre>
  
  <p>Do you have any idea why? It looks correct to me.</p>
  
  <p>But If I'm moving the quotes (putting them like this ['@id=MiddleColumn']) it works perfect, but I'm assuming that in this case Selenium kind of confused and not even validate it, therefore it's passing the test. Here is the example:</p>
  
  <pre><code>public IWebElement AccountInfoTitle() 
  { 
      return Driver.FindElement(By.XPath("//*['@id=MiddleColumn']/div['h2=Account Information']")); 
  }
  </code></pre>
  
  <p>Thanks in advance.</p>