You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Java version of Selenium there was a @cacheLookup annotation that allowed to cache found WebElement class objects right inside of the ElementLocator class that searched for them.
If ElementLocator is to be used as a standalone component, then it might make sense, but the PageFactory is creating a separate locator class per each Page/ElementContainer class property it decorates and only accesses it once when element is being used, so caching doesn't really make sense.
We might implement the caching if somebody will be using ElementLocator in custom factory to save on calls made to the browser for element location. This cache however might result in stale element returning, that is no longer present in DOM.
The text was updated successfully, but these errors were encountered:
In the Java version of Selenium there was a
@cacheLookup
annotation that allowed to cache foundWebElement
class objects right inside of theElementLocator
class that searched for them.If ElementLocator is to be used as a standalone component, then it might make sense, but the
PageFactory
is creating a separate locator class per each Page/ElementContainer class property it decorates and only accesses it once when element is being used, so caching doesn't really make sense.We might implement the caching if somebody will be using ElementLocator in custom factory to save on calls made to the browser for element location. This cache however might result in stale element returning, that is no longer present in DOM.
The text was updated successfully, but these errors were encountered: