I have a complex issue and I need your help !
On one of my test, I make 3 verifications on my first results page.
Each verification is in Gherkin language and corresponding to keywords (here is an extract) :
Then the page only displays the SALE transaction type in main research
And the page only displays the APPARTMENT type in main research
And the page only displays the MILLAU locality in main research
Those verifications work on my first result page but when the user click on the “Next” button, the second page of results appear… and I must make the same verification on this page (and the following…)
Is it possible only with Robotframework’s keywords or should I use the Python code to write it?
I can duplicate the verificaion on the next page but I would like to loop it for each pagewhen the user click on “Next”.
You should have some keyword to click “Next page” in the pagination area, right? Why don’t you call those keywords inside it? e.g.
User clicks next page
Click next page
the page only displays the SALE transaction type in main research
the page only displays the APPARTMENT type in main research
the page only displays the MILLAU locality in main research
I agree with @donzoolo’s advice. I don’t think there’s a Keyword in Robot Framework or in Selenium Library that will magically do this for you.
Also, is this a Test that you are automating or a Task? Meaning, will you know beforehand whether there are 3 pages in the grid or maybe 10 grid pages? Or perhaps you can do a “show all results” on the grid so that there are no pages beyond 1 page?
I think a screen shot of your page will help us help you.
If this is a test you are automating, then the ideal way to handle this would be to use an account/username or an environment where you can control the data that is there.
Or maybe do a WHILE loop where it keep clicking on ‘Next Page’ while it is enabled…something along those lines. Such complicated Keyword might be best handled in Python vs. Robot Framework.
But again, you might be trying to get your automation to do more than it should be doing…especially if this is a test you are trying to automate.