Class DOMObjectValidator

java.lang.Object
org.uitnet.testing.smartfwk.ui.core.objects.UIObjectValidator
org.uitnet.testing.smartfwk.ui.core.objects.DOMObjectValidator

public class DOMObjectValidator
extends UIObjectValidator
Author:
Madhav Krishna
  • Constructor Details

    • DOMObjectValidator

      public DOMObjectValidator​(SmartAppDriver appDriver, DOMObject domObject, org.sikuli.script.Region region)
  • Method Details

    • getUIObject

      public DOMObject getUIObject()
      Overrides:
      getUIObject in class UIObjectValidator
    • getAttributeValue

      public String getAttributeValue​(String attributeName, int maxIterationsToLocateElements)
      Returns the attribute value of the first element.
      Parameters:
      attributeName -
      maxIterationsToLocateElements -
      Returns:
    • getAttributeValueWhenElementVisible

      public String getAttributeValueWhenElementVisible​(String attributeName, int maxIterationsToLocateElements)
      Finds attribute value from element when it is not hidden.
      Parameters:
      maxIterationsToLocateElements -
    • getAttributeValueWhenAttributeValueNonEmpty

      public String getAttributeValueWhenAttributeValueNonEmpty​(String attributeName, int maxIterationsToLocateElements)
      Finds attribute value from visible element when it's value is not empty. Leading and trailing whitespace will be removed in comparision.
      Parameters:
      maxIterationsToLocateElements -
    • findElement

      public org.openqa.selenium.WebElement findElement​(int maxIterationsToLocateElements)
      Finds first element with polling and it polls after 2 seconds for maxIterationsToLocateElements times.
      Specified by:
      findElement in class UIObjectValidator
      Parameters:
      maxIterationsToLocateElements -
      Returns:
    • waitForPageLoad

      public void waitForPageLoad()
    • findElementNoException

      public org.openqa.selenium.WebElement findElementNoException​(int maxIterationsToLocateElements)
      Finds first element with polling and it polls after 2 seconds for maxIterationsToLocateElements times. It does not throw any exception
      Specified by:
      findElementNoException in class UIObjectValidator
      Parameters:
      maxIterationsToLocateElements -
      Returns:
    • findElements

      public List<org.openqa.selenium.WebElement> findElements​(int maxIterationsToLocateElements)
      This returns all the elements based on the locator. It waits for the configured timeout if the element is not present. Performs polling maxIterationsToLocateElements times.
      Specified by:
      findElements in class UIObjectValidator
      Parameters:
      maxIterationsToLocateElements -
      Returns:
    • scrollElementOnViewport

      public DOMObjectValidator scrollElementOnViewport​(Scrollbar scrollbar)
      Specified by:
      scrollElementOnViewport in class UIObjectValidator
    • isPresent

      public boolean isPresent​(int maxIterationsToLocateElements)
      Return true only if first element is present but it might not be visible.
      Specified by:
      isPresent in class UIObjectValidator
      Parameters:
      maxIterationsToLocateElements -
      Returns:
    • isVisible

      public boolean isVisible​(int maxIterationsToLocateElements)
      Return true only if element is visible.
      Specified by:
      isVisible in class UIObjectValidator
      Parameters:
      maxIterationsToLocateElements -
      Returns:
    • isReadonly

      public boolean isReadonly​(int maxIterationsToLocateElements)
    • isDisabled

      public boolean isDisabled​(int maxIterationsToLocateElements)
    • isDisabledButNotReadonly

      public boolean isDisabledButNotReadonly​(int maxIterationsToLocateElements)
    • isSelected

      public boolean isSelected​(int maxIterationsToLocateElements)
      Determine whether or not this element is selected or not. This operation only applies to input elements such as checkboxes, options in a select and radio buttons.
      Returns:
      True if the element is currently selected or checked, false otherwise.
    • getText

      public String getText​(int maxIterationsToLocateElements)
      Finds text from element when element is present in HTML.
      Parameters:
      maxIterationsToLocateElements -
    • getTextWhenElementVisible

      public String getTextWhenElementVisible​(int maxIterationsToLocateElements)
      Finds text from element when it is not hidden.
      Parameters:
      maxIterationsToLocateElements -
    • getTextWhenElementValueNonEmpty

      public String getTextWhenElementValueNonEmpty​(int maxIterationsToLocateElements)
      Finds text from visible element when it's value is not empty. Leading and trailing whitespace will be removed.
      Parameters:
      maxIterationsToLocateElements -
    • validatePresentWithNonEmptyText

      public void validatePresentWithNonEmptyText​(int maxIterationsToLocateElements)
      Validates whether the element is visible with non-empty text on screen.
      Parameters:
      maxIterationsToLocateElements -
    • copyTextToClipboard

      public void copyTextToClipboard​(int maxIterationsToLocateElements)
      Copy text into clipboard from the current cursor position. Applicable only for editable fields i.e textbox, textarea etc. First it will click on that element and then select all text and copy into clipboard.
    • pasteTextFromClipboard

      public void pasteTextFromClipboard​(int maxIterationsToLocateElements)
      Replace the content of the element with the clipboard contents. Applicable only for editable fields i.e textbox, textarea etc.
    • click

      public void click​(int maxIterationsToLocateElements)
      Specified by:
      click in class UIObjectValidator
    • doubleClick

      public void doubleClick​(int maxIterationsToLocateElements)
      Specified by:
      doubleClick in class UIObjectValidator
    • rightClick

      public void rightClick​(int maxIterationsToLocateElements)
      Specified by:
      rightClick in class UIObjectValidator
    • clickAndHold

      public void clickAndHold​(int maxIterationsToLocateElements)
      Specified by:
      clickAndHold in class UIObjectValidator
    • release

      public void release​(int maxIterationsToLocateElements)
      Specified by:
      release in class UIObjectValidator
    • dragAndDrop

      public void dragAndDrop​(DOMObject target, int maxIterationsToLocateElements)
    • performKeyDown

      public void performKeyDown​(org.openqa.selenium.Keys keys, int maxIterationsToLocateElements)
      Specified by:
      performKeyDown in class UIObjectValidator
    • performKeyUp

      public void performKeyUp​(org.openqa.selenium.Keys keys, int maxIterationsToLocateElements)
      Specified by:
      performKeyUp in class UIObjectValidator
    • performKeyPressed

      public void performKeyPressed​(org.openqa.selenium.Keys keys, int maxIterationsToLocateElements)
      Specified by:
      performKeyPressed in class UIObjectValidator
    • typeText

      public void typeText​(String text, NewTextLocation location, int maxIterationsToLocateElements)
      Specified by:
      typeText in class UIObjectValidator
    • getNewMobileTouchAction

      public io.appium.java_client.TouchAction getNewMobileTouchAction()
      Specified by:
      getNewMobileTouchAction in class UIObjectValidator
    • getNewMobileMultiTouchAction

      public io.appium.java_client.MultiTouchAction getNewMobileMultiTouchAction()
      Specified by:
      getNewMobileMultiTouchAction in class UIObjectValidator
    • getNewSeleniumActions

      public org.openqa.selenium.interactions.Actions getNewSeleniumActions()
      Specified by:
      getNewSeleniumActions in class UIObjectValidator