I am currently learning page object model (POM) and I am trying to access a specific web element using @FindBy but I am not sure how to correctly write the syntax for my element into @FindBy?

What I have is:


So my question is how do I place a[da-qid='inventory'] correctly into @FindBy?


By, a[da-qid='inventory'], what I mean is that it selects every <a> element whose da-qid value begins with 'inventory'.

3 Answers 3


I've used that kind of locators in my last project and it's worked like charm. I hope this is that You want :)

  • Awesome, thanks! This is what I was look for.
    – Robben
    Jul 23, 2015 at 20:31

I can't give you an exact answer without seeing the full element, but the official documentation on selectors ought to help you out.


This syntax might help u check out. @FindBy(locator="locator value") private WebElement elementName; Don't forget in POM we follow encapsulation concept

  • Hi @Anand welcome to SQA, We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed. Jul 27, 2015 at 4:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.