Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8559431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:02:40+00:00 2026-06-11T16:02:40+00:00

How can I assert an xpath match that contains single quotes within the string

  • 0

How can I assert an xpath match that contains single quotes within the string to be asserted?

This is my string with value '40' to be asserted.

I assumed to escape the single quote characters with \' but that does not work.

matches( //faultstring[1]/text(), 'This is my string with value \'40\' to be asserted.' )

How is this done properly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:02:41+00:00Added an answer on June 11, 2026 at 4:02 pm

    Try this

    //faultstring[matches(text(),''')]
    

    or

    //faultstring[matches(text(),''')]
    

    or

    //faultstring[matches(text(),''')]
    

    For a more elegant solution see this post

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I pass a C# string variable into an xpath selector? This is for
In NUnit, I can write either Assert.That(5, Is.EqualTo(5)); or Assert.AreEqual(5, 5); Is there any
I can only assume this is a bug. The first assert passes while the
Using Jess as the rule engine, we can assert a fact that some witness
How can you assert that an expected type is returned when it is wrapped
How can i Assert that the CSS for a page has successfully loaded and
I'm doing TDD using Python and the unittest module. In NUnit you can Assert.Inconclusive(This
How can I assert that a variable satisfies any one of two values in
Is there a way I can assert that two constant expressions are equal at
How can i assert that a method on a mocked object was called exactly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.