I am trying to book a flight and book seats on a flight website.I record the steps to book the flight and assign seats.But when i run the test, it tries to pick the same seats i already picked earlier which is now disabled. How can i instruct QTP to pick the next available seat? I have attached screen shot of the seat map.
Youu could write a custom function to assign each seat an x,y coordinate, then check a small bitmap area to see if it matches green, yellow, gray, etc.
A huge pain in the backside, but ultimately doable.
As for me, I would probably just query the database where this flight stores its seat assignments and pick one that is available in the database.
Of course, at some point, you probably want a function that looks at the seat you selected and verifies that it is displaying the correct color - validating that your application correctly displays the user selections.
So if you're going to write that one, modifying it a bit to determine availability wouldn't be too much of a stretch.
"The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"