I was trying to find solution on similar topics, but i was not successful.
WebUI.click(findTestObject('Tiger/01-Search/12-SearchTourResult/SearchHotelSource/Source4/HotelSource4Order1ShowHideTours1'))
This object contains combo-xpath, which says find in the results first hotel with data source 4 and click on the first button.
Each button has default state - “check”. When i click on check - it might return the state “reserve” but it could be also “not available” and more states which are not important.
I need to get “reserve” to finish the test case. Sometimes it happens after more attempts (buttons). Depends on the availability of a term.
What would be suitable to use, loop statement FOR
?
If yes, how to write it in the script inside test case.
Lets say i would like to use 5 attempts, till it finds the desired button "reserve"
Usually when i use click on reserve, i just use in object simple
//*[(text() = 'Rezervovat' or . = 'Rezervovat')]
If fifth attempt will fail too, it should be stopped. It usually means that entire hotel is not available at all.