Package org.openqa.selenium.support.ui
Class Quotes
- java.lang.Object
-
- org.openqa.selenium.support.ui.Quotes
-
public class Quotes extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description Quotes()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
escape(java.lang.String toEscape)
Convert strings with both quotes and ticks into a valid xpath component
-
-
-
Method Detail
-
escape
public static java.lang.String escape(java.lang.String toEscape)
Convert strings with both quotes and ticks into a valid xpath componentFor example,
foo
will be converted to"foo"
,f"oo
will be converted to'f"oo'
,foo'"bar
will be converted toconcat("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\""
-
-