Class Annotations

    • Constructor Summary

      Constructors 
      Constructor Description
      Annotations​(java.lang.reflect.Field field)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void assertValidAnnotations()  
      org.openqa.selenium.By buildBy()
      Defines how to transform given object (field, class, etc) into By class used by webdriver to locate elements.
      protected org.openqa.selenium.By buildByFromDefault()  
      protected java.lang.reflect.Field getField()  
      boolean isLookupCached()
      Defines whether or not given element should be returned from cache on further calls.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Annotations

        public Annotations​(java.lang.reflect.Field field)
        Parameters:
        field - expected to be an element in a Page Object
    • Method Detail

      • isLookupCached

        public boolean isLookupCached()
        Defines whether or not given element should be returned from cache on further calls.
        Specified by:
        isLookupCached in class AbstractAnnotations
        Returns:
        true if @CacheLookup annotation exists on a field
      • buildBy

        public org.openqa.selenium.By buildBy()
        Defines how to transform given object (field, class, etc) into By class used by webdriver to locate elements. Looks for one of FindBy, FindBys or FindAll field annotations. In case no annotations provided for field, uses field name as 'id' or 'name'.
        Specified by:
        buildBy in class AbstractAnnotations
        Returns:
        By object
        Throws:
        java.lang.IllegalArgumentException - when more than one annotation on a field provided
      • getField

        protected java.lang.reflect.Field getField()
      • buildByFromDefault

        protected org.openqa.selenium.By buildByFromDefault()
      • assertValidAnnotations

        protected void assertValidAnnotations()