Example: lr.continue_on_error

In the following example, the replay skips to the next iteration if it encounters an error in the login.

public int login(string username, string password)

{

//emulate failed login

return lr.FAIL;

}

lr.continue_on_error(LR_ON_ERROR_SKIP_TO_NEXT_ITERATION);

int status = login("username","password");

 

if (status == lr.FAIL) {

string strOutputMsg="Error: Unable to login to server"

lr.output_message(strOutputMsg);

}

lr.continue_on_error(LR_ON_ERROR_NO_OPTIONS);