- Explore
Introduction, screen-shots, features, limitations
- Getting started
Prerequisites, download, install, browser configuration, record, playback, view logs
- Sahi Scripting Basics - I
Statements, variables, functions, conditions and looping, _include
- Sahi Scripting Basics - II
- Sahi APIs (built-in functions)
- All APIs
- Browser Accessor APIs
- Browser Action APIs
- Miscellaneous APIs
- Sahi Scripting - Calling Java
- Exception handling using try-catch
- Recovering without try-catch using _setRecovery
- Script lifecycle call back functions
onScriptFailure, onScriptError, onScriptEnd
- Data Driven Testing
_getDB, CSV Files, Excel, Databases
- Multithreaded Playback (Parallel execution)
suites, commandline, ant
- Advanced techniques, tips and examples
- HTTPS/SSL Sites
- Configuring an External proxy
- Adding jars to Sahi's classpath
- Configuring Browser Types
- Sahi GUI Less Installation
- Sahi headless with PhantomJS
- Sahi headless with Xvfb
- Sahi with Android
- Tweaking Sahi APIs
- Jenkins Integration
- Sending Emails
- CSV Files as Suites with Tags
- Working with SSH
- Reading PDF Files
- Run Sahi Scripts from Java
- Other language drivers
Driving Sahi from Java, Ruby etc.
- Java
- Ruby
- Trouble Shooting Sahi
- Sahi Pro
- Sahi Pro V4.2 Documentation (PDF)
- Excel Framework
- Load Testing (Beta)
- Sahi Flex Support - sfl (Beta)
- Sahi Applet Support (Beta)
- Running tests on multiple machines
- Web based Testrunner
Exceptions are handled via regular javascript try catch blocks since Sahi V2.
Syntax
try{
// sahi statements
}catch(e){
// Corrective action
// Can print exact source of error in log
// Can throw the same or another exception
}
Eg.
Corrective Action
try{
_click(_link("does not exist"));
}catch(e){
_log("Exception occured"); // simple logging. no failure
_click(_link("linkByHtml")); // Corrective action
}
Corrective Action and Log the Exception Message
try{
_click(_link("does not exist"));
}catch(e){
_click(_link("linkByHtml")); // Corrective action
_logException(e); // Logs the exception, but does not fail
}
Corrective Action, Log and then Fail
try{
_click(_link("does not exist"));
}catch(e){
_click(_link("linkByHtml")); // Corrective action
_logExceptionAsFailure(e); // Logs the exception, and fails,
// and in the logs, points to the original line as source of failure.
}