Hey guys,
I have a little question, maybe someone can give a little advice on this:
I have a web page, let’s say it’s a booking website with multiple hotels, and every hotel displayed has a “book now” button.
My question here is, how do i select a specific button? Manual recording did not help on this one.
How do we choose for a specific button that is present multiple times on a page?
Thanks!
Hi Alex,
you may want to find some other identifier rather than button text. What about HTML element’s id? If you want, you can add a snippet from your page’s source code and we may find something.
The “Rezerva” button is the one i am talking about
katalon.jpg
Is there any unique element in parent box? I.e. offer ID or specific route details. We can use also parent’s identified to identify Rezerva button.
There is no unique identifier for every button
I meant identifier for whole parent
And what about flight number? Is this part unique for all reservations?
<span class=""><span class="semibold">Id zbor:</span> FR2104</span>
If there is really nothing unique, the only way how to click specific button is to find the button by index.
You can get i.e. third button on the page using this xpath:
(//a[@class="book"])[3]
Yes, flight number is unique, but changes from search to search