Hello,
I’m new in Robotframework and I have an issue with my test in RobotFramework.
On a page, there are many element with this locator :
//*[@class=“resultats mode_liste ng-scope”]/div[@ng-repeat="annonce in resultats.data.annonces "]//h2/a/strong[1][@class=“ng-binding”]
Example of structure :
- A “div” element contains “locator1” which contains “House”
- A “div” element contains “locator1” which contains “House”
- A “div” element contains “locator1” which contains “Box”
In my test, I want to check that each element contains, for example, the word “House”.
I have tried to do this :
Element Should Contain //*[@class=“resultats mode_liste ng-scope”]/div[@ng-repeat="annonce in resultats.data.annonces "]//h2/a/strong[2][@class=“ng-binding”] Box
But the robot check only the first element with this locator. And I want to check that the word “Box” is present in EACH element with this locator.
The result is not what I expected (error if another word than “House” is founded on the locator1)
Any idea?
Thanks a lot !