title: How to handle special characters like single/double quotes/space inside XPATH JAVA
body: <p>I'm trying to click on element using below code and its working fine if variable does not have special characters.   </p>
  
  <p>Values that passed in variable are: </p>
  
  <pre><code>Product  Passed
  Test Message -&gt; Failed
  Double Units 13/2" -&gt; failed
  </code></pre>
  
  <p>I cannot go with partial text, because sometimes only difference between two element is special character.</p>
  
  <pre><code>String Answertoselect = ElementName.replaceAll("'", "\\\\'");
  String selectanswer = Answertoselect.replaceAll(" ", "${nbsp}");
  </code></pre>