title: SyntaxError: Failed to execute 'evaluate' on 'Document':
body: <p>Can anyone please tell me, if there is any mistake with my xpath. I have made it dynamic, to accept values from the parameter passed.</p>
  
  <p><strong>Xpath used in my code as :</strong></p>
  
  <pre><code>wait.until(ExpectedConditions.presenceOfAllElementsLocatedBy(By.xpath("//div[@id='categories_block_left']/div[1]/ul[1]/li/a[contains(text(),'"+subCategory+"')]/Preceding-sibling::span[1]")));
  </code></pre>
  
  <p><strong>Xpath I am getting on run time in the console after execution:</strong></p>
  
  <pre><code>//div[@id='categories_block_left']/div[1]/ul[1]/li/a[contains(text(),'Tops')]/Preceding-sibling::span[1]
  </code></pre>
  
  <p>If I try to inspect above(runtime) by mentioning <code>xpath</code> in Firpath console, it is getting detected. But selenium is not able to detect this element. </p>
  
  <p>Here is page URL: </p>
  
  <pre><code>http://automationpractice.com/index.php?id_category=3&amp;controller=category
  </code></pre>
  
  <p>In the eclipse console I am getting error as : </p>
  
  <pre><code>Expected condition failed: waiting for presence of any elements located by By.xpath: //div[@id='categories_block_left']/div[1]/ul[1]/li/a[contains(text(),'Tops')]/Preceding-sibling::span[1]
  SyntaxError: Failed to execute 'evaluate' on 'Document':
  </code></pre>