Thanks for your time first & foremost.
Problem:
I am automating a product which in the not so distant future will have multilingual support switched on, I have setup a simple resource bundle reading from a .properties
file (English.properties
, French.properties
and so fourth).
In my Page Objects I have some @FindBy
notations referencing some linkText for a number of hyperlinks on the pages, e.g: "Forgot Password". This linkText will obviously change when we switch locale.
Do I abandon these @FindBy(linkText = "Forgot Password")
locators and use something else available to locate them which won't have an impact on the language.
OR
Is there a means in which I can provide dynamic content in the @FindBy
to cater to this? For example:
@FindBy(linkText = (Language.getLanguage().getString("foo"))
I'm curious as to what people do in this problem?
Trying my solution returns the following:
The value for annotation attribute FindBy.linkText must be a constant expression