Package io.github.the_sdet.common
Class CommonUtils
java.lang.Object
io.github.the_sdet.common.CommonUtils
This class handles various common Utilities and Helper methods
- Author:
- Pabitra Swain ([email protected])
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetIntegerValue(String elementText) This method extracts numeric integer value from a string.static doublegetNumericValue(String elementText) This method extracts numeric value from a string.static StringreplaceLineBreaksWithSpace(String input) Replaces line breaks in the input string with spaces.static voidWaits for the specified duration.
-
Field Details
-
EMPTY_STRING
Represents a String without content.
-
-
Constructor Details
-
CommonUtils
public CommonUtils()
-
-
Method Details
-
getNumericValue
This method extracts numeric value from a string. E.g., -$300.00 will return 300.00- Parameters:
elementText- String value from which number to be extracted.- Returns:
- number in double format
-
getIntegerValue
This method extracts numeric integer value from a string. E.g., -$300.00 will return 300- Parameters:
elementText- String value from which number to be extracted.- Returns:
- number in integer format
-
waitFor
Waits for the specified duration.- Parameters:
duration- The duration to wait.
-
replaceLineBreaksWithSpace
Replaces line breaks in the input string with spaces.- Parameters:
input- The input string.- Returns:
- The input string with line breaks replaced by spaces.
-