Sahi vs. Selenium

10
Sahi vs. Selenium Though Sahi is aimed at non-programmer testers and Selenium at programmers, we get a lot of queries on their differences. Here is a brief document which compares Selenium and Sahi. To those who read this: 1. If you are a Selenium fan, be open minded and verify the claims for yourself or contact us for clarification. And again, please be open minded. You may save a lot of time for yourself and your team. 2. This document is biased towards Sahi because we built Sahi. We believe what we state is true, but if you have evidence to prove otherwise, please do contact us at [email protected]. 3. When we say "Not sure" or "?" it means we do not have enough information because of lack of research on our part. Please verify for yourself. 4. If you want a comparison between other tools and Sahi, we would be happy to discuss it. 5. If you are another tool developer/supporter, please let us know how it compares and let the world benefit from alternatives. Sahi vs. Selenium: Comparison document Recorder Selenium Sahi Works only on Firefox Works on all browsers (IE, FF, Chrome, Safari, Opera) Has trouble recording IFrames, Frames and popup windows Can record on IFrames, Frames and popup windows For Frames and IFrames, need to explicitly selectFrame Implicit smart identification of elements even across Frames and IFrames

Transcript of Sahi vs. Selenium

Page 1: Sahi vs. Selenium

Sahi vs. Selenium Though Sahi is aimed at non-programmer testers and Selenium at programmers, we get a lot of queries on their differences. Here is a brief document which compares Selenium and Sahi.

To those who read this:1. If you are a Selenium fan, be open minded and verify the claims for yourself or

contact us for clarification. And again, please be open minded. You may save a lot of time for yourself and your team.

2. This document is biased towards Sahi because we built Sahi. We believe what we state is true, but if you have evidence to prove otherwise, please do contact us at [email protected].

3. When we say "Not sure" or "?" it means we do not have enough information because of lack of research on our part. Please verify for yourself.

4. If you want a comparison between other tools and Sahi, we would be happy to discuss it.

5. If you are another tool developer/supporter, please let us know how it compares and let the world benefit from alternatives.

Sahi vs. Selenium: Comparison document

Recorder

Selenium Sahi

Works only on Firefox Works on all browsers (IE, FF, Chrome, Safari, Opera)

Has trouble recording IFrames, Frames and popup windows

Can record on IFrames, Frames and popup windows

For Frames and IFrames, need to explicitly selectFrame

Implicit smart identification of elements even across Frames and IFrames

Uses XPath for identification of elements if id or name not present

Uses various algorithms to uniquely identify elements in a simple human recognizable way

Programming Language support

Selenium Sahi

Java, Ruby, Perl, Python, C# (and may be more).

Sahi Script, Java, Ruby Sahi Script has the syntax of javascript but can interoperate with any Java code directly from script. The Java/Ruby drivers are available since Sahi V3

Page 2: Sahi vs. Selenium

Needs language bridges for each new feature. For example, needs java bridge to invoke Flash via ExternalAPI.

Sahi Script can directly invoke anything exposed by javascript.

Ease of use

Selenium Sahi

Easy to start with because of Selenium IDE which is a firefox plugin. Estimated start time less than 5 minutes

More difficult than Selenium to start because it needs installation of Sahi. Estimated start time 10-30 minutes, depending on Java installation etc.

Deep learning curve when the need is felt to move from Selenium IDE to Selenium RC.

There is only one mode of operation for Sahi. Extremely simple to learn and use for testers

Knowledge of programming language required

Can achieve most automation with just functions and variables. Sahi has inbuilt APIs for most other complex tasks like data driven testing

Needs JUnit style of programming Can choose your own style

Uses XPath based identification for elements in complex html structures or those with dynamic ids. css selectors and javascript may also be used.

Has nearness APIs like _in and _near which can help show nearness of elements. Eg. _image(“delete.gif”, _near(“username 4”))

Needs waits for making AJAX work No waits needed in 90% cases

Supports parallel execution Inbuilt parallel execution. Needs only one parameter change

Stability of scripts and ease of maintenance

Selenium Sahi

Smart DOM Relations resilient to UI changes

NoDependent on XPathDifficult for testers to understand and debug

YesDoes not use XPaths.Uses _near and _in

Implicit waits for page load and AJAX:1) Saves time2) Keeps scripts simple3) Reduces random failures

NoExplicit waits needed.

Yes

Ease of adoption by a team of testers

Needs testers to know TestNG/Junit, XPaths, HTML

Sahi abstracts out all these for the tester.

Page 3: Sahi vs. Selenium

structures, Frames IFrame knowledge, Javascript for AJAX conditional waits

Dependency on other tools

Selenium – Java (Others need something similar)

Sahi

Needs JUnit (and optionally eclipse) to run tests

No additional tools required. Tests run from the Sahi Controller/command line/ant

Non persistent reporting. Needs TestNG or something similar for that

Persistent HTML reporting which can be shared via URL or file

Stability of product and number of releases

Selenium Sahi

Started 2004(?) in ThoughtWorks Started 2005 in ThoughtWorks

Version 1 took 5 years, Version 2 planned mid-2010. Moving away from original architecture to WebDriver based architecture

Current release: Version 3 Number of stable releases in 2009: 7

Footprint

Selenium Sahi

RC: 10.5 MB, Grid 15 MB less than 2 .5 MB with source

Not sure Runtime ~ 50MB for 3 parallel threads

Reporting

Selenium Sahi

Needs external tools to create readable reports

Inbuilt HTML reports with click through to relevant portion of script

Others

Selenium Sahi

Build tool integration (ant, batch files)

Yes Yes

Multiple OS support Yes Yes

Version Controllable Scripts/Code

Yes Yes

Page 4: Sahi vs. Selenium

HTTPS support/redirects Not sure Yes

401 Authentication, Windows/NTLM Authentication dialogs

Not sure Yes

External proxy tunneling Yes Yes

In built APIs for data driven testing

No Yes

Works only with browsers Yes Yes

Needs privileged modes on browsers for operation. (Privileged is bad)

Yes No

Extensible on future browsersDepends on finding a way to use privileged mode on that browser

Yes. Very little dependency on type of browser.

Editor support Has good editors in various languages

Editor support for javascript is not as good as for Java.

Support available

Selenium Sahi

Free support via Forums Yes Yes

Paid support available Yes Yes

Authoritative training available

? Yes

Posted by V. Narayan Raman at 8:58 PM

13 comments:

felix said...

How about stability?

Even selenium scores badly against webdriver...

Saturday, April 24, 2010 11:46:00 PM PDT

V. Narayan Raman said...

Hi Felix,Stability is something that comes up again and again. Thanks for bringing up that point.

Page 5: Sahi vs. Selenium

The cause for instability generally is due to 1) Timeouts: when the server does not respond within time, the tests break. The tool should have the intelligence to wait for the necessary time. Sahi monitors page loads and AJAX and waits till activity has subsided. Selenium requires explicit waits or waits with conditions. The conditional wait is preferred but it complicates the script and demands more from the tester.2) Scripts very dependent on UI changes. In the absence of ids, Selenium is very dependent on XPaths, which is a hassle for testers. If the tester does not tweak the XPath, the tests will be brittle. Tweaking XPath for lots of UI elements is not a trivial task and can take up valuable tester time.

Sunday, April 25, 2010 10:34:00 PM PDT

zawistol said...

Raman,What would you recommend for Flex testing, we have a few folks using QTP with Flex add in.Lech

Wednesday, April 28, 2010 7:19:00 AM PDT

V. Narayan Raman said...

Hi Lech,

We are adding support for Flex too. It will follow the same principles of Sahi so it should be simple. If your requirement is urgent, you could check out FlexMonkey. http://www.gorillalogic.com/flexmonkey

Regards,Narayan

Wednesday, April 28, 2010 10:11:00 AM PDT

David Burns said...

Selenium does use XPath but does not rely on it. Selenium has a number of different locator techniques from using IDs or Names to CSS or XPath. You can even use JavaScript if you wanted.

Selenium, like Sahi, can invoke External APIs as long as you can access them via JavaScript. It something that is widely used by Developers/Testers around the world.

Page 6: Sahi vs. Selenium

Selenium 2 has implicit waits. Its something that Selenium has been lacking and was one of the things that we needed to do and have now done. Users can use the implicit wait but these will still timeout after a while because something not loading quickly can show a bug, its not that the test is brittle.

Everything else looks correct from the Selenium point of view as far as I can see.

Friday, April 30, 2010 1:00:00 AM PDT

V. Narayan Raman said...

Hi David,

Thanks for stopping by and sharing your knowledge. I have updated the post with your information.

Selenium 2 is still in alpha so I am not adding in implicit waits yet :)

Thanks,Narayan

Monday, May 3, 2010 9:28:00 PM PDT

psylence said...

Does Sahi handles subdomains while testing? As i understood, selenium does not..

Tuesday, May 11, 2010 4:47:00 AM PDT

V. Narayan Raman said...

Hi psylence,

Yes Sahi works with subdomains. You may need to modify sahi/htdocs/spr/domainfix.js to set document.domain to the base domain.

Tuesday, May 11, 2010 6:38:00 AM PDT

psylence said...

Raman, thanks for your answer!

Btw, i have problems running Sahi on MacOS X. I've gooled and found this one:

Page 7: Sahi vs. Selenium

http://sahi.co.in/forums/viewtopic.php?id=36 but it not helped(

Maybe you can give some tips, thanks.

Tuesday, May 11, 2010 7:22:00 AM PDT

V. Narayan Raman said...

Hi psylence,

If you post your problem on the Sahi Forums (http://sahi.co.in/forums) or email us at [email protected], we will be able to guide you.

Wednesday, May 12, 2010 12:58:00 AM PDT

psylence said...

Raman, thanks! I"m already managed to make it running finally.

Wednesday, May 12, 2010 8:05:00 AM PDT

halperinko said...

Are there any plans for SAHI to support legacy Windows and/or Java applications not under a web browser?

Thursday, August 19, 2010 4:39:00 AM PDT

V. Narayan Raman said...

Hi Halperinko,

Thanks for the interest.

Currently we are concentrating only on the web. We do not have plans for windows/Java apps right now.

You could have a look at White for Windows Apps, Frankenstein for Swing apps and SWTBot for SWT apps.

Thanks,Narayan

Thursday, August 19, 2010 6:42:00 AM PDT

Page 8: Sahi vs. Selenium