I was testing Openbravo using testproject but what happens is the ‘click element’ Action doesn’t work always sometimes the test gets passed the element locator finds the element properly and the same test sometimes gets failed if we run later because the element locator unable to click or find that element shows ‘No Matches’ ,
And if i use the Action ‘Contains any text’ then also element locator is unable to find and click that written text …so is there any steps or a different way to encounter this issue ?
- First, try to edit the element like in the image below,
To check your locators use the magnifying glass
(notice the element must be present on the page when checking a locator):
If another locator is more consistent make it your primary locator, push it to the top with the arrows next to the magnifying glass.
- Check for a unique attribute and search the button by that locator,
you can make your custom locator like this for example:
For instance, my locator for Amazon looks like this:
However, you can use TestProject built-in locator generator like this:
by pressing double shift on any element you can freeze it and then extract multiple XPath
You can also take a look on this article for more information: