"Oracle Certified Master, Java EE 5 Enterprise Architect" Certified. TOGAF 9 Foundation Certified. Software Architect with more than 8 years of professional hands-on software development experience; utilizing best practices, Object Oriented designs and open standards in developing Portals and enterprise multi-tier applications. BSc from Jordan University faculty of Engineering & Technology – Electrical Engineer Department. Mohammad is a DZone MVB and is not an employee of DZone and has posted 8 posts at DZone. You can read more from them at their website. View Full User Profile

Selenium Vs WebTest

  • submit to reddit

Selenium and WebTest are two frameworks available for web test automation. This article compares both frameworks based on a set of 8 questions to help to choose between them.

1 ) Which one has the better IDE?
2 ) How easy / fast to write a comprehensive test case?
3 ) How easy is it to enhance and modify your test case scenario ?
4 ) Dealing with Javascript errors?
5 ) How easy is it to integrate your web test cases with project ?
6 ) What are the things that are in WebTest that you will miss in Selenium?
7 ) Documentation?
8 ) Generated Reports?


Which one has the better IDE?

Selenium has the better IDE , Selenium IDE is advanced and has a lot of luxuries. WebTest IDE is elementary.

How easy/fast to write a comprehensive test case?

In Selenium and WebTest it is easy to write test cases, but Selenium is much easier than WebTest ... of course this is related to point 1(Selenium IDE is advanced compared with WebTest)!

How easy is it to enhance and modify your test case scenario ?

In Selenium this will be easier because of 2 reasons:
a) The test case is executed on the browser , so anyone can easily guess what is the flow and can suggest enhancements on the test case, no need to take a look at the code to guess what this test case is doing.
b ) Because Selenium IDE gives u the ability to modify your test case in a very friendly straight forward way, WebTest IDE does not.

Dealing with Javascript errors?

Selenium does not care if there is a JavaScript error or not, so you cannot depend on Selenium alone to guess JavaScript errors in the application!!!
WebTest does care about JavaScript errors, and it will not let you continue your test till you fix all JavaScript errors.

The first impression regarding this point that WebTest is better, right?
But this is not the case always, because sometimes you have to deal with a project that has many JavaScript errors and all what you want and need is to test functionality , server-side validation , flow ….
Selenium is your hero here…

WebTest will not continue executing test case if it discover any javascript error so it will let you down here..
The optimum thing in my opinion is to have the ability to test functionality and flow regardless if there is Javascript errors or not, and to have the ability to find JavaScript errors in screens.
I mean Javascript error should not stop you from testing the flow and functionality for screens.

But how we can do that?
Simply you can use FireBug FireFox plugin which catch JavaScript errors while Selenium is executing the TestCases, this helped me a lot before , Trust me in this ;)
So my opinion for this point is:
Selenium + FireBug is much better than WebTest.. .

How easy is it to integrate test cases with project ?

WebTest integration with projects is easy! You can easily integrate it to your build file,and it is will become easier to use continues integration tools like CruiseControl to run test cases.
WebTest much better here.

What the things that are in WebTest that you will miss in Selenium?

In WebTest you can verify text inside Excel and PDF.


The same .. no one wins here!

Generated Reports?

WebTest Reports is better, but the difference is not that much.

Based on the above , I do recommend Selenium ...

Published at DZone with permission of Mohammad Juma, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


David Freels replied on Wed, 2008/08/13 - 12:20pm

TryTellurium (http://code.google.com/p/aost/) for a different way to write Selenium tests

JS Bournival replied on Wed, 2008/08/13 - 3:32pm

The IDE is not the only "important" point in choosing between these two. 

For starters, Selenium is very helpful when you want to test a web application in different browsers.  WebTest doesn't do that: it's using HTMLUnit. 

On the other hand, WebTest is more suitable for continuous integration.  It provides nice reports with HTML snapshot of the page under test so you can clearly seewhat went wrong.

Also, I found configuring Selenium to use SSL a real PITA.  Let's not talk about the issues related to all different browsers executables, proxy, etc. Setup time with WebTest is much smaller, and less frustrating.

With Selenium, you can write your tests in Selanese (html tables ... yuck!), or in a nice variety of scripting languages like Python and Ruby. WebTest supports XML, and Groovy.  So both of them are allowing dynamic languages power features.

One last thing: WebTest is based on ANT, so it's no big deal to build your own extensions.

I work for a client that has a normalized browser (IE6), so to me, WebTest made more sense since I don't need Selenium's versatility.  Also, the projects I'm working on are in Java, so Groovy is a winner to write my test scripts.

Btw,  WebTest also has a firefox plugin to generate test scripts.  Look for it.

Marc Guillemot replied on Mon, 2008/08/18 - 8:00am

WebTest has no IDE but a recorder (which is not perfect at all but has some features that SeleniumIDE has not). Remember that the D in IDE stands for Development. Calling a recorder an IDE means that your expectations for the development are really minimal.

You can configure WebTest to ignore JS errors but the default is to help you to catch errors in your application ASAP.

From the different points that are not mentionned here, one is particularly important when your test suite grows beyond an initial evaluation phase: execution time!

Mohammad Juma replied on Mon, 2008/08/18 - 12:00pm


thanx for ur reply,

Facilitating writing and modifying  test cases is something very important... WebTest recorder compared with SeleniumIDE is not helpful a lot for this.

in addition to that the way that Selenium executes tests -executes test on browser -will let anyone(Bzns analyst, project manager, technichal team leader, office boy ... )  Feel and know what this test is doing without any need to read single line of code

Regarding Performance issue in Selenium .. Did u hear about Selenium Grid?

Using Selenium Grid  you can distribute your tests on multiple machines so that you can run your tests in parallel, cutting down the time required for running in-browser test suites.






Suresh Suri replied on Fri, 2010/04/23 - 1:13am

My Scenario I have login page where I enter username and password, once I successfully logged in the welcome page opens in a different BROWSER. But when I record Selenium is not identifying the new BROWSER. How to handle this issue?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.