Interview Questions

WinRunner: How to test if a link exists and is valid

Mercury WinRunner FAQ


(Continued from previous question...)

WinRunner: How to test if a link exists and is valid

Use the web_link_valid command, then add some conditional logic to say whether or not the test passed.
# verify the link is valid
set_window("Default Menu", 1);
yes = web_link_valid("YOUR PRODUCT APPLICATION", valid);
if (yes == 0)
report_msg("link exists on page");
else
report_msg("no link");

(Continued on next question...)

Other Interview Questions