Class CommonUtils

java.lang.Object
io.github.the_sdet.common.CommonUtils

public class CommonUtils extends Object
This class handles various common Utilities and Helper methods
Author:
Pabitra Swain ([email protected])
  • Field Details

    • EMPTY_STRING

      public static String EMPTY_STRING
      Represents a String without content.
  • Constructor Details

    • CommonUtils

      public CommonUtils()
  • Method Details

    • getNumericValue

      public static double getNumericValue(String elementText)
      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

      public static int getIntegerValue(String elementText)
      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

      public static void waitFor(Duration duration)
      Waits for the specified duration.
      Parameters:
      duration - The duration to wait.
    • replaceLineBreaksWithSpace

      public static String replaceLineBreaksWithSpace(String input)
      Replaces line breaks in the input string with spaces.
      Parameters:
      input - The input string.
      Returns:
      The input string with line breaks replaced by spaces.