title: Accessing html Span tag in Selenium
body: <p>I want to access the collection of <code>span</code> tag which is having <code>value attribute</code> like below<br></p>
  
  <p><code>&lt;span class="label_xmlvalue_row value" value="Automation_TestBundle_13thMarch"&gt;</code><br></p>
  
  <pre><code>&lt;iframe&gt;
  &lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;table&gt;
  &lt;tbody&gt;
  &lt;tr class="empty"&gt;there are no items in this view&lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;td&gt;
  &lt;span class="bigger value"&gt;
  &lt;span class="text"&gt;3. Author&lt;/span&gt;
  &lt;/span&gt;
  &lt;/td&gt;
  
  &lt;td&gt;
  &lt;span class="label_xmlvalue_row value" value="Automation_TestBundle_13thMarch"&gt;
  &lt;span class="text" title="Task Name: Automation_TestBundle_13thMarch"&gt;Task Name: 
  &lt;span class="xmlvalue"&gt;Automation_TestBundle_13thMarch&lt;/span&gt;
  &lt;/span&gt;
  &lt;/span&gt;
  &lt;/td&gt;
  
  &lt;td&gt;
  &lt;span class="bigger value"&gt;
  &lt;span class="text"&gt;3. Author&lt;/span&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;
  &lt;td&gt;
  &lt;span class="bigger value"&gt;
  &lt;span class="text"&gt;Reviewer&lt;/span&gt;
  &lt;/span&gt;
  &lt;/td&gt;
  
  &lt;td&gt;
  &lt;span class="label_xmlvalue_row value" value="TestBundle_13thMarch"&gt;
  &lt;span class="text" title="Task Name: TestBundle_13thMarch"&gt;Task Name: 
  &lt;span class="xmlvalue"&gt;TestBundle_13thMarch&lt;/span&gt;
  &lt;/span&gt;
  &lt;/span&gt;
  &lt;/td&gt;
  
  &lt;td&gt;
  &lt;span class="bigger value"&gt;
  &lt;span class="text"&gt;3. Author&lt;/span&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;tr&gt;.....&lt;/tr&gt;
  
  
  &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  &lt;/iframe&gt;
  </code></pre>
  
  <p><br></p>
  
  <p>So I have tried few things and bringing it to your notice</p>
  
  <pre><code>1. driver.switchTo.Frame(element);
  var ele = driver.FindElements(By.TagName("span"));
  ele.Text property gives "Cannot access dead object"
  
  2. driver.switchTo.Frame(element);
  IWebElement ele =  driver.FindElements(By.TagName("span")).Where(x=&gt;x.GetAttribute("Value").Equals("Automation_TestBundle_13thMarch")).First();
  
  Exception thrown - Invalid Operation Exception
  Inner Exception = null
  Message = can't access dead object
  </code></pre>
  
  <p><br>
  1. Can we access the span tag directly without finding the html element(<code>/html/body/table/tbody/tr/td</code>)? <br>If means why in this case it is throwing an exception.<br>
  2. If not please provide me an alternate solution.</p>
  
  <p>Thanks in advance.</p>