Class Quotes

java.lang.Object
org.openqa.selenium.support.ui.Quotes

public class Quotes extends Object
  • Constructor Details

    • Quotes

      public Quotes()
  • Method Details

    • escape

      public static String escape(String toEscape)
      Convert strings with both quotes and ticks into a valid xpath component

      For example,

      foo will be converted to "foo",

      f"oo will be converted to 'f"oo',

      foo'"bar will be converted to concat("foo'", '"', "bar")

      Parameters:
      toEscape - a text to escape quotes in, e.g. "f'oo"
      Returns:
      the same text with escaped quoted, e.g. "\"f'oo\""