Question 1. What Is Sahi?
Sahi is a tool that helps automate testing of browser based applications. It is released under an Apache 2 license.If you work with web applications, you need to test the product before each release. Testing can be done manually but it may take a long time and may become repetitive and boring. Automation can make this testing (or checking) very fast and free up the tester for more useful exploratory testing. Typically a 1000 script suite can be executed in as less as 6-8 hours. This means that regression tests can run overnight and you can have results when you come in the next morning.
Question 2. But Does It Not Take A Lot Of Effort To Create And Write Scripts And Maintain Them? We Had Once Attempted It And Failed!?
Question 3. Really? How Does Sahi Work?
Question 4. Sahi Has A Recorder? Is A Recorder Helpful? I Have Heard That Record And Playback Is Frowned Upon ?
Sahi has a good recorder for recording user actions. Good recorders are excellent time savers for testers. Pure record and playback does not work however. The recorder is used to record snippets of code and then functions are created which are reused in scripts. Nevertheless, the recorder (or rather the object spy) saves 30 to 40% time spent in identifying elements and creating user flow.
Question 5. Oh, So Do I Need To Know Programming? Does It Involve Coding?
Question 6. Why Not Use Java Or C#?
Sahi has Java and Ruby drivers. However, testers find Sahi script to be the easiest to work with. Choose which ever works for your business.
Question 8. I Have Heard That Testing Code Is Like Development Code. It Needs To Be Architected, Refactored And Maintained Like Production Code?
No this is not correct. Automation code SHOULD be simplistic without too many conditions/loops/inheritance etc. It is even OK to have duplication in automation code. If a script fails, one should be able to right away suspect the application under test rather than the testing code. This can only happen if the testing code is trivially simple.
Question 9. That Was A Useful Digression On Automation Code. Coming Back To Sahi, How Does Sahi Work With Various Browsers? Do I Need To Write Separate Scripts For Each Browser?
No. A script written for one browser will work on any browser. Sahi takes care of normalizing the differences across browsers.
Question 10. How Does Sahi Identify Elements?
Question 11. What Is Xpaths?
XPaths are frowned upon in Sahi. XPaths are normally used to traverse data represented as XML. HTML structures are not really data but UI representations and are prone to modification. XPaths starting from the root node are almost never useful. One has to then modify it using a regular expression. When a script fails, the first suspect is normally the expression and not the AUT. This wastes a good amount of tester’s time. There are also differences in XPath implementations which add to the tester’s troubles.
Question 12. One Of The Main Problems In Our Current Browser Automation Is That We Need To Add Waits Everywhere. Can You Add Waits In Sahi?
In 99% cases, Sahi does not need waits. Sahi automatically waits for page/frame/iframe loads and also for any AJAX activity. Even after waiting if a step fails, Sahi retries it 5 times at 2 second intervals before it reports a failure. Due to this Sahi scripts are very stable and have very few false negatives.
Question 13. My Application Uses Lots Of Frames And Iframes. How Does Sahi Handle This?
Sahi automatically traverses frames and iframes to identify elements. One does not need to specifically choose a frame before working with it.
Question 14. What About Popup Windows?
Question 15. Does It Support File Uploads And File Download Dialogs?
File uploads are handled in a round about way in Sahi. Sahi adds the file to the HTTP request via the proxy. For file downloads, files are automatically downloaded to a temp location by Sahi and the script allows interaction with these files.The file upload part can get tricky in HTML5 apps on some browsers, so you may need to resort to native events which are supported in Sahi Pro.
Question 16. Ok, Once I Have A Few Scripts, Can I Run Them In Batch? Can I Hook Into My Continuous Integration System?
Yes Sahi has a concept of suites. Suites can be triggered from .bat files, shell scripts and ant. You can trigger Sahi scripts from CI systems using its ant target.
Question 17. Do We Need To Build Reporting Logging Etc ?
No, Sahi automatically logs all statements that are executed, without the tester adding any code. It also builds a summary report in HTML of all script executions in a suite.
LoadRunner Interview Questions
Manual Testing Interview Questions
Selenium Interview Questions
Bugzilla Bug Tracking System Interview Questions
Bugzilla Bug Tracking System Tutorial
Automation Testing Interview Questions
LoadRunner Interview Questions
Software testing Tutorial
Software testing Interview Questions
Test Cases Interview Questions