[Http-webtest-general] chaining click_link tests
Brought to you by:
m_ilya,
richardanderson
From: bruce <br...@ir...> - 2003-05-19 18:41:50
|
I suspect this would be a frequently asked question, but I can't find the answer in the cookbook nor in the mailing list archives, so here goes. I would like to have a series of tests where each page is reached from clicking a link on the previous page. Thus, the tests would look something like this: test_name = Account options page url = http://localhost/accountoptions text_require = ( Account Options ) end_test # click a link on the accountoptions page test_name = unsubscribe page click_link = Remove a game from your subscription text_require = ( Remove a Game ) end_test # click a link on the unscubscribe page test_name = unsubscribe from game 1 click_link = Unsubscribe params = ( id => 1 ) text_require = ( Confirm unsubscribe from ) end_test # click a link on the confirmation page test_name = confirm unsubscribe click_link = Confirm Unsubscription text_require = ( You have been unsubscribed ) end_test By default, WebTest will attempt to click a link found on the "http://localhost/accountoptions" page for each of these tests, and so all but the first one will fail. What is the easiest way to modify the wtscript so that the click_link commands cascade? I'd prefer _not_ to have to inject "url =" tests throughout, if that's possible. -- Bruce |