Package jp.vmi.selenium.selenese.utils
Class SeleniumUtils
- java.lang.Object
-
- jp.vmi.selenium.selenese.utils.SeleniumUtils
-
public class SeleniumUtils extends Object
Utilities for Selenium.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSeleniumUtils.SeleniumPatternstring-matching pattern of SeleniumIDE.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> StringconvertToString(T result)Convert to String from the result of execute().static StringdoubleToString(double d)Stringify the double value.static booleanisElementNotFound(RuntimeException e)Check if Exception type is "element not found".static StringnormalizeSpaces(String str)Unifty U+0020 and U+00A0, Trim, and compress spaces in string.static booleanpatternMatches(String pattern, CharSequence input)String-match pattern.static voidwindowMaximize(org.openqa.selenium.WebDriver driver)Maximize window with workaround.
-
-
-
Method Detail
-
patternMatches
public static boolean patternMatches(String pattern, CharSequence input)
String-match pattern.- Parameters:
pattern- pattern. prefix is "glob:", "regexp:", "regexpi:", or "exact:".input- input string.- Returns:
- true if matched pattern.
-
normalizeSpaces
public static String normalizeSpaces(String str)
Unifty U+0020 and U+00A0, Trim, and compress spaces in string.- Parameters:
str- string.- Returns:
- normalized string.
-
doubleToString
public static String doubleToString(double d)
Stringify the double value. If the double value is mathematically an integer, drop fraction part.- Parameters:
d- double value.- Returns:
- stringified double value.
-
convertToString
public static <T> String convertToString(T result)
Convert to String from the result of execute().- Type Parameters:
T- the type of result object.- Parameters:
result- the result of execute().- Returns:
- converted string.
-
isElementNotFound
public static boolean isElementNotFound(RuntimeException e)
Check if Exception type is "element not found".- Parameters:
e- RuntimeException- Returns:
- true if the exception is "element not found".
-
windowMaximize
public static void windowMaximize(org.openqa.selenium.WebDriver driver)
Maximize window with workaround.- Parameters:
driver- WebDriver instance.
-
-