I\'m not sure that I understand the caching principle :
@CacheLookup
@FindBy(how = How.ID, using = namespace + signifLvl)
private WebElement sigLvl;
<
Page Factory works on the principle of configuring the proxies when Page Factory is initialized and every time you use a WebElement it will go and search for the element.
Now what cachelookup does is it stores elements having @cachelookup annotation applied over it and then stores this element for further reference/s. For example:
public class SearchPage {
// The element is now looked up using the name attribute,
// and we never look it up once it has been used the first time
@FindBy(how = How.NAME, using = "q")
@CacheLookup
private WebElement searchBox;
public void searchFor(String text) {
// We continue using the element just as before
searchBox.sendKeys(text);
searchBox.submit();
} }
What this annotation does is it stores the value the searchBox element and now there is no need to search for this element on webpage again.