Class JSelectors

java.lang.Object
io.jmix.masquerade.JSelectors

public class JSelectors extends Object
Utility class that provides the selectors of the SelenideElement wrappers. Used to find SelenideElement wrappers for web-components.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    The By selector, which find a web-element by its displayed text.
    static class 
    The By selector, which finds a web-element with the UI_TEST_ID attribute equals to the simple name of the web-element's wrapper class.
    static class 
    The By selector, which find a web-element by the value of the UI_TEST_ID attribute.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.openqa.selenium.By
    byChained(org.openqa.selenium.By... bys)
     
    static org.openqa.selenium.By
    byDisplayedText(String displayedText)
    Creates and returns a By selector that finds the web-element that has display text that contains the passed value at the last position in the DOM tree.
    static org.openqa.selenium.By
    byDisplayedText(String displayedText, int elementPosition)
    Creates and returns a By selector that finds the web-element that has display text that contains the passed value at the passed element position in the DOM tree (can be useful if several elements contain the same text).
    static org.openqa.selenium.By
    byDisplayedText(String displayedText, String tagName)
    Creates and returns a By selector that finds the web-element that has display text that contains the passed value with the passed element tag name at the last position in the DOM tree.
    static org.openqa.selenium.By
    byDisplayedText(String displayedText, String tagName, int elementPosition)
    Creates and returns a By selector that finds the web-element that has display text that contains the passed value with the passed element tag name at the passed element position in the DOM tree (can be useful if several elements contain the same text).
    static org.openqa.selenium.By
    Creates and returns a By selector that finds the web-element with the UI_TEST_ID attribute equals to the simple name of the web-element's wrapper class.
    static org.openqa.selenium.By
    byPath(String... uiTestIdPath)
     
    static org.openqa.selenium.By
    byUiTestId(String uiTestId)
    Creates and returns a By selector that finds the web-element with the UI_TEST_ID attribute equals to the passed value.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • byPath

      public static org.openqa.selenium.By byPath(String... uiTestIdPath)
      Parameters:
      uiTestIdPath - path of UI_TEST_ID attributes to the element
      Returns:
      By selector by which the web-element can be found
    • byChained

      public static org.openqa.selenium.By byChained(org.openqa.selenium.By... bys)
      Parameters:
      bys - sequence of the By selectors by which the web-element can be found
      Returns:
      chained By selectors
      See Also:
      • ByChained
    • byJavaClassName

      public static org.openqa.selenium.By byJavaClassName(Class<?> clazz)
      Creates and returns a By selector that finds the web-element with the UI_TEST_ID attribute equals to the simple name of the web-element's wrapper class.
      Parameters:
      clazz - target web-element wrapper class
      Returns:
      By selector
    • byUiTestId

      public static org.openqa.selenium.By byUiTestId(String uiTestId)
      Creates and returns a By selector that finds the web-element with the UI_TEST_ID attribute equals to the passed value.
      Parameters:
      uiTestId - UI_TEST_ID attribute value
      Returns:
      By selector
    • byDisplayedText

      public static org.openqa.selenium.By byDisplayedText(String displayedText)
      Creates and returns a By selector that finds the web-element that has display text that contains the passed value at the last position in the DOM tree.
      Parameters:
      displayedText - text that is contained in the displayed text
      Returns:
      By selector
    • byDisplayedText

      public static org.openqa.selenium.By byDisplayedText(String displayedText, String tagName)
      Creates and returns a By selector that finds the web-element that has display text that contains the passed value with the passed element tag name at the last position in the DOM tree.
      Parameters:
      displayedText - text that is contained in the displayed text
      tagName - target element tag name
      Returns:
      By selector
    • byDisplayedText

      public static org.openqa.selenium.By byDisplayedText(String displayedText, int elementPosition)
      Creates and returns a By selector that finds the web-element that has display text that contains the passed value at the passed element position in the DOM tree (can be useful if several elements contain the same text).
      Parameters:
      displayedText - text that is contained in the displayed text
      elementPosition - position of target element in DOM tree
      Returns:
      By selector
    • byDisplayedText

      public static org.openqa.selenium.By byDisplayedText(String displayedText, String tagName, int elementPosition)
      Creates and returns a By selector that finds the web-element that has display text that contains the passed value with the passed element tag name at the passed element position in the DOM tree (can be useful if several elements contain the same text).
      Parameters:
      displayedText - text that is contained in the displayed text
      tagName - target element tag name
      elementPosition - position of target element in DOM tree
      Returns:
      By selector