I've created a complete test case using the cucumber and everything is fine.
I've used the XPath for targeting the elements.
And using the XPath was a little messy.
I want to add a new property in all the elements for making it easier to targeting elements.
Should I add the "tag" property in elements?
And also for using that, Should I use the "tagName" in the @FindBy?
If so, what name would you suggest for the tag property?
Something like "ui_testing_button" is good?
While Cucumber works well with Selenium WebDriver, we don't offer technical support for Selenium WebDriver. Please ask in their forums.
I suggest to use HTML data attributes for that purpose: https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes
It is good practice to use `data-test-*` for test related custom data attributes.
As selenium does not provide dedicated methods to work with data attributes, it is possible to retrieve those easily with standard css query selectors like `
By.cssSelector("[data-test-id: \"my-unique-test-id\"]")` as see here: https://sqa.stackexchange.com/questions/39202/selenium-locate-elements-via-custom-attribute