title: Finding an element by partial id with Selenium in C#
body: <p>I am trying to locate an element with a dynamically generated id. The last part of the string is constant ("ReportViewer_fixedTable"), so I can use that to locate the element.  I have tried to use regex in XPath:</p>
  
  <pre><code>targetElement = driver.FindElement(
      By.XPath("//table[regx:match(@id, "ReportViewer_fixedTable")]"));
  </code></pre>
  
  <p>And locating by CssSelector:</p>
  
  <pre><code>targetElement = driver.FindElement(
      By.CssSelector("table[id$='ReportViewer_fixedTable']"));
  </code></pre>
  
  <p>Neither works.  Any suggestions would be appreciated.</p>