title: Alternative of contains in cssSelector ? Selenium WebDriver
body: <p>I am using selenium 2 (WebDriver).</p>
  
  <p>I am locating a button and clicking by the script:</p>
  
  <pre class="lang-java prettyprint-override"><code>driver.findElement(By.cssSelector("button:contains('Run Query')")); 
  </code></pre>
  
  <p>or </p>
  
  <pre class="lang-java prettyprint-override"><code>driver.findElement(By.cssSelector("css=.gwt-Button:contains('Run Query')")) 
  </code></pre>
  
  <p>whose html is like : </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;button type="button" class="gwt-Button" id="ext-gen362"&gt;Run Query&lt;/ 
  button&gt; 
  </code></pre>
  
  <p>As the id is dynamically generated, I can't make use of the ID. </p>
  
  <p>Is there any way to use cssSelector with something like contains ? Is this possible?</p>