title: ImageTag exists in the TR?
body: <p>EDIT:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public bool getImage()
  {
      IWebElement table = driver.FindElement(By.Id("DIV_ID_1"));
  
      string name = String.Format("//*[contains(text(), \'{0}\')]", 'TEST1');
      IWebElement element = table.FindElement(By.XPath(name));
      IWebElement parent = element.FindElement(By.XPath(".."));
  
      try
      {
          IWebElement image = element.FindElement(By.XPath("//img"));
      }
      catch (NoSuchElementException e)
      {
          return false;
      }
  
      return true;
  }
  </code></pre>
  
  <p>How would I find out if the <code>TEST1</code> does have <code>Image</code>? in the below html source code, I have tr and within tr i have td and some tr may have image tag and some may not</p>
  
  <p>So, I will be passing name for an example: <code>TEST1</code> and in returns I will be expecting if the name has Image tag or not.</p>
  
  <p>again, if I pass <code>TEST2</code> and <code>TEST3</code> it should <code>return</code> <code>null</code> since it does not have an image tag and where as <code>TEST1</code> and <code>TEST4</code> does have <code>Image tag</code> hence it should return me true.</p>
  
  <p>I tried something like this but did not work:</p>
  
  <pre class="lang-cs prettyprint-override"><code>string name = String.Format(".//td[contains(., \'{0}\')]/..//@src", "TEST1");
  IWebElement element = driver.FindElement(By.XPath(name));
  </code></pre>
  
  <p>get this error: after trying the above code...</p>
  
  <blockquote>
    <p>The xpath expression './/td[contains(., 'TEST1')]/..//@src' 
    cannot be evaluated or does notresult in a WebElement</p>
  </blockquote>
  
  <p>Below is the html source code</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div id="DIV_ID_1"&gt;
      &lt;table id="TBLID1"&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  TEST1
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;img id="ctl00" src="../App_Themes/Default/images/phone.gif" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  TEST2
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  TEST3
              &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  TEST4
              &lt;/td&gt;
              &lt;td&gt;
                  &lt;img id="ctl02" src="../App_Themes/Default/images/phone.gif" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>