0

I am new to Sahi and I am just trying to take a screenshot on script errors. I have tried to used their demo and the script the website provides for the task, but the onScriptFailure doesn't seem to trigger. I added the alert box and changed the log in name to trigger a failure. Sorry if i'm missing something obvious.

  function onScriptError($e){
  _focusWindow();
  _takeScreenShot();
  _alert("test me");
}
onScriptFailure = onScriptError;
_navigateTo("http://sahi.co.in/demo/training/");
_setValue(_textbox("user"), "test");
_setValue(_password("password"), "secret");
_click(_submit("TriggerError"));
ithken
  • 11
  • 3

2 Answers2

1

I was using Sahi Pro. I actually got the answer from their support department. This is what he had me do:

var onScriptError = function ($e) {
  _focusWindow();
  _takeScreenShot();
  _alert("test me");
}
onScriptFailure = onScriptError;
_navigateTo("http://sahi.co.in/demo/training/");
_setValue(_textbox("user"), "test");
_setValue(_password("password"), "secret");
_click(_submit("TriggerError"));
ithken
  • 11
  • 3
0

HI You can use the GlobalInclude.sah file which has the code for the error handling. you can edit this file to make the script behave according to your needs

Mrinal kumar
  • 67
  • 1
  • 1
  • 9