title: Selenium element not found when running by IE
body: <p>The selenium test passed by Firefox.
  But When I'm trying to run it by IE, I get the error "Element xpath... not found"</p>
  
  <pre><code>string xpath = string.Format("xpath=(//table[@id='{0}']/tbody/tr[not(contains(@class,'{1}'))])[{2}]",tableId, CLASS_HIDDENROW,rowNumber);
  string rowid = Selenium.GetAttribute(string.Format("{0}/@id",xpath));
  </code></pre>
  
  <p>I debugged it and found <code>Selenium.GetXpathCount("//table[@id='328829']")</code> returns 0, which means IE even can't find the table with the id.</p>
  
  <p>But when I use "View Source" on IE  I found the following scripts</p>
  
  <pre><code>&lt;table id="328829" class="scroll" cellpadding="0" cellspacing="0" style="z-index:1;"&gt;&lt;/table&gt;
  </code></pre>
  
  <p><strong>more information</strong>
  souce code(*.aspx)</p>
  
  <pre><code>&lt;div id="&lt;%=gridDef.gridId%&gt;Wrapper" class="&lt;%If Model.gridDefinitions.Count = 1 Then %&gt;SummaryDiv&lt;%Else%&gt;HiddenRow&lt;%End If %&gt;" class="HiddenRow" style="position:relative;overflow:auto;overflow-y:hidden;"&gt;
              &lt;table width="100%"&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;span style="font-weight:bold;font-size:14px;color:#38AEF2"&gt;&lt;%=gridDef.caption%&gt;&lt;/span&gt;&lt;/td&gt;
                      &lt;td align="right"&gt;&lt;a style="cursor:pointer" onclick="$('#&lt;%=gridDef.gridId%&gt;tableWrapper').toggle();return false;"&gt;&lt;%="vbeiHide/Show".TranslateHTML()%&gt;&lt;/a&gt;&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
              &lt;br /&gt;
              &lt;div id="&lt;%=gridDef.gridId%&gt;tableWrapper" name="&lt;%=gridDef.gridId%&gt;tableWrapper"&gt;
                  &lt;table id="&lt;%=gridDef.gridId%&gt;" class="scroll" cellpadding="0" cellspacing="0" style="z-index:1;"&gt;&lt;/table&gt;
                  &lt;input type="image" src='../../Images/add2.gif' style="width:1px;height:1px;"/&gt;
                  &lt;input id="&lt;%=gridDef.gridId%&gt;_Create_Image" type="image" src="../../Images/add2.gif" title="&lt;%="vbeiCreateANewSample".Translate() %&gt;" onfocus="duplicateRow('#&lt;%=gridDef.gridId%&gt;','&lt;%=gridDef.newTemplateId%&gt;'); this.blur(); return false;" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>
  
  <p>html when running</p>
  
  <pre><code>          &lt;div id="328829Wrapper" class="HiddenRow" class="HiddenRow" style="position:relative;overflow:auto;overflow-y:hidden;"&gt;
              &lt;table width="100%"&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;span style="font-weight:bold;font-size:14px;color:#38AEF2"&gt;Polluted Soil&lt;/span&gt;&lt;/td&gt;
                      &lt;td align="right"&gt;&lt;a style="cursor:pointer" onclick="$('#328829tableWrapper').toggle();return false;"&gt;Hide / Show&lt;/a&gt;&lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
              &lt;br /&gt;
              &lt;div id="328829tableWrapper" name="328829tableWrapper"&gt;
                  &lt;table id="328829" class="scroll" cellpadding="0" cellspacing="0" style="z-index:1;"&gt;&lt;/table&gt;
                  &lt;input type="image" src='../../Images/add2.gif' style="width:1px;height:1px;"/&gt;
                  &lt;input id="328829_Create_Image" type="image" src="../../Images/add2.gif" title="Create a new sample" onfocus="duplicateRow('#328829','template_328829'); this.blur(); return false;" /&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;script type="text/javascript"&gt;
              jQuery("#328829").jqGrid({
                  url: "/Ordering/LoadData?gridId=328829",
                  editurl: "clientArray",
                  datatype: "json",
                  hoverrows : false,    
                  mtype: 'POST',
                  loadui : "disable",
                  colNames: ['Options','Sample code (*)','Sample comments','SS Date Time Field (*)','IsTemplate','favourite name','favourite isShared','favourite sampleId'],
                  colModel: [{name: 'Options', index: 'Options', editable: false, hidden: false, sortable: false, resizable: false, edittype: 'text', width: 90, formatter:optionsFormatter },{name: 'Sample_Name', index: 'Sample_Name', editable: true, hidden: false, sortable: false, resizable: false, edittype: 'text', width: 150, editoptions: {maxlength: 50} },{name: 'Sample_Comments', index: 'Sample_Comments', editable: false, hidden: true, sortable: false, resizable: false, edittype: 'text' },{name: '51455962', index: '51455962', editable: true, hidden: false, sortable: false, resizable: false, edittype: 'text', editoptions: { dataInit:function(elem){attachDateTimePicker(elem);} } },{name: 'IsTemplate', index: 'IsTemplate', editable: false, hidden: true, sortable: false, resizable: false, edittype: 'checkbox' },{name: 'favourite_name', index: 'favourite_name', editable: false, hidden: true, sortable: false, resizable: false, edittype: 'text' },{name: 'favourite_isShared', index: 'favourite_isShared', editable: false, hidden: true, sortable: false, resizable: false, edittype: 'checkbox' },{name: 'favourite_sampleId', index: 'favourite_sampleId', editable: false, hidden: true, sortable: false, resizable: false, edittype: 'text' }],
                  imgpath: "/css/redmond/images",
                  height: "100%",
                  rowNum:-1,
                  altRows: true,
                  loadComplete: function() { loadComplete("#328829", 3);},
                  afterInsertRow: function(rowid, rowdata, rowelem) { rowInserted("#328829", rowid, rowdata); }
              });
  
          &lt;/script&gt;      
  </code></pre>
  
  <p>I also try to add the following scripts when setup, but it doesn't work.</p>
  
  <pre><code>if (browser == Browser.IE) {
      selenium.UseXpathLibrary("javascript-xpath");
      selenium.AllowNativeXpath("true");
  }
  </code></pre>
  
  <p>Can someone tell me how to solve this problem? BTW, code is C#.</p>