Interview Questions

Winrunner testscript for checking all the links at a time

Mercury WinRunner FAQ


(Continued from previous question...)

Winrunner testscript for checking all the links at a time

location = 0;
set_window("YourWindow",5);

while(obj_exists((link = "{class: object,MSW_class:
html_text_link,location: "& location & "}"))== E_OK)
{
obj_highlight(link);	   
web_obj_get_info(link,"name",name);
web_link_valid(link,valid);
if(valid)
      tl_step("Check web link",PASS,"Web link
       \"" && name && "\" is valid.");
    else
      tl_step("Check web link",FAIL,"Web link \""
       && name && "\" is not valid.");
 location++;
}

(Continued on next question...)

Other Interview Questions