title: How to handle Apostrophes ( ' ) using XPATH in QTP
body: <p>chk this code snippet</p>
  
  <p>Please refer the below code.</p>
  
  <p><code>rv = “Are you 56' taller ?”</code> </p>
  
  <p>If I pass 20 fields ie, until [<code>rv = “ Are you 56' taller ? "</code>]. 
  It’s not working because ‘ – apostrophe is used to comment in QTP</p>
  
  <p>How to handle ' ( apostrophe ) in Xpath using QTP ?</p>
  
  <p>Code Snippet:</p>
  
  <pre><code> rv = Replace (rv,"'", "\'")
   rv = LEFT(rv,50)
  
   If SVAL = "Yes" Then
  
   Set oobj = Browser("xyz").Page("abc").WebElement("xpath:=//div[contains(text(),'"&amp; rv &amp;"')]/../..//label[starts-with(text(),'Yes')]")
   oobj.Click
   oobj.Click
  
   i = i+1             
  
  End If
  </code></pre>
  
  <p>I really appreciate your reply.</p>