I'm using WinRunner to run regression tests on a Web-based application. One test that I want to run is the creation of a new record, followed by the retrieval of that data. The problem is that the newly created records are only retrievable by activating their record number hyperlink. Since the number of the hyperlink is only assigned once the record is created, I can't ''learn'' the hyperlink in the GUI map until after the record has been created. Any suggestions?
Not knowning what your application looks like or how it behaves,I'll assume the following:
1) Once you create a new record the record number is displayed to the user to be used for future retrievals. (You should be able to grab this value, and save it to a variable win/obj_get_text)
2) The records are stored in a database and the record number is automatically incremented.
3) The application presents a listing of record numbers when the user wants to retrieve a record.
I'll guess that the retrieval screen looks something like the following:
<a href=''1.htm''> 1 </a> abc
<a href=''2.htm''> 2 </a> def
<a href=''3.htm''> 3 </a> ghi
1) Your initial and ending conditions should be planned. Ideally, you should be able to start with a known database and be able to predict the ''next'' record number. When the test is completed you should be able to roll the database back to the ''known'' state. This would then allow you to always have the same links in the retrieval screen.
2) (More of an ad-hoc approach to ''Testing'', ) If you have a dynamic list of hyperlinks (retrievable records) you may want to learn one of these links and modify the GUI Map description by using regular expressions. Then use a win/obj_find_text or win/obj_click_on_text to find and click on the record number.
I can't ''learn'' the hyperlink in the GUI map until after the record has been created. Any suggestions?