-
Hi there. I'm mainly using findBy annotation to define web elements on a page like below:
When the page is reloaded in background these references become stale. Is there a way to refresh the references defined above? I'm aware of dynamic referencing using the $-key but I would prefer to use findBy annotations instead. Thanks and best regards, André. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
This is a known issue with the PageFactory approach - my solution is never to use @findby annotations. |
Beta Was this translation helpful? Give feedback.
-
Thanks, John! Unfortunately, I've used this approach in all my projects because it looked very smart to me in the beginning. What are you suggesting instead? (I'm not using screenplay pattern.) |
Beta Was this translation helpful? Give feedback.
-
@wakaleo Dear John. I'd like to replace the findBy annotation by dynamic selectors but predefining is causing a compiler exception:
Could you please advice how to makte it correctly? Thanks and best regards, André |
Beta Was this translation helpful? Give feedback.
-
FYI: I decided to use By instead of FindBy annotation:
|
Beta Was this translation helpful? Give feedback.
This is a known issue with the PageFactory approach - my solution is never to use @findby annotations.