I'm not sure that I understand the caching principle :
@CacheLookup
@FindBy(how = How.ID, using = namespace + signifLvl)
private WebElement sigLvl;
If we use this Annotation way, ElementLocator is being used and the first time one refer to the field, the element is found driver.findElement(by)
and cached via ElementLocator, so that next time we refer to it, it is returned from the cache.
It looks it depends on the lifetime of the ElementLocator & PageObject instance.
Also it doesn't relate to direct driver.findElement(By);
calls.
I'm assuming, that WebElement is like a pointer/reference to the element, right ? So that if the element changes in browser, it is reflected to the WebElement right away. As it is in JavaScript. Because all RemoteWebElement's methods regarding element's state are executing command/request to browser.
So that the changes are reflected even in the cached element, right ?