Manual testing is not fun and most of not really enjoy repeatedly testing in different browsers. The other problem is that as human we are not good at doing repetitive work. But still we need to get our work done and we can’t afford missing a single critical bug. The computes have a better solution to this problem because they are good at boring and repeatable tasks. Automate your ongoing testing and your problem is solved. Here we are giving some unbiased reviews on some popular automation services which might work best for you.

Selenium

If you ever searched web automation on google, you surely know about Selenium. When it comes to browser automation Selenium is clearly the elephant in the room.  It uses so called WebDriver API which is already implement in nearly all modern browsers. Selenium has created many different WebDriver implementations for this which are available for every OS and browser combination imaginable.  You can create tests in many different programming languages like Java,  Python, .Net, JavaScript and many more. Here is a small sample test:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

// Create new webdriver and start browser

WebDriver driver = new FirefoxDriver();

Wait<WebDriver> wait = new WebDriverWait(driver, 30);

 

// Open Google

driver.get(“http://www.google.com/“);

 

// search for cheese in google

driver.findElement(By.name(“q”)).sendKeys(“cheese”);

 

// click search

driver.findElement(By.name(“btnG”)).click();

 

// Wait for search to complete

wait.until(new ExpectedCondition<Boolean>() {

public Boolean apply(WebDriver webDriver) {

return webDriver.findElement(By.id(“resultStats”)) != null;

}

});

 

// Check results

assertTrue(driver.findElement(By.tagName(“body”)).getText().contains(“cheese”);

 

//close the browser

driver.close();

In nutshell, Selenium is quite powerful The FireFox Plugin (called Selenium IDE) can be used to log test cases. It is open source and 100% free to use.

Pros:

Works on nearly every browser and OS combination imaginable

Possible to integrate in variety of different tools and build systems

Powerful and browser vendor supported API

Open Source and 100% free to use

Cons:

Good “Know How”of program is a must to create tests.

Selenium is quite slow on some browsers.

Resources

Selenium Homepage

Selenium basics tutorial

Sahi

Sahi is not popular as Selenium. It has different direction than Selenium. You can install Sahi on your local machine and this tool will act as a proxy between the browser and the web application under test. It will inject some JavaScript into the page which will record the test cases. It is written in Java + JavaScript and therefore supports almost all operating systems and browsers. Special scripting language is required to write test. Here is an example:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

_navigateTo(“http://sahi.co.in/demo/training/“);

 

// login

_setValue(_textbox(“user”), “test”);

_setValue(_password(“password”), “secret”);

_click(_submit(“Login”));

 

// add books

_setValue(_textbox(“q”), “1”);

_setValue(_textbox(“q[1]”), “2”);

_setValue(_textbox(“q[2]”), “3”);

_click(_button(“Add”));

 

// verify Total

_assertExists(_textbox(“total”));

_assert(_isVisible(_textbox(“total”)));

_assertEqual(“1550”, _getValue(_textbox(“total”)));

 

// logout

_click(_button(“Logout”));

In contrast to Selenium you can use Sahi without any coding skills  as it has quite powerful integrated recorder. It is available both as  commercial application and open source.

Pros:

Works on almost every OS and browser combination

Supports recording of tests

No heavy configuration is required

Cons:

Advanced features (mainly reporting) are not available in free version.

Installed locally, integration in build process is hard (but possible)

Resources

Sahi Homepage

An introduction to Sahi

Helium

Helium a simplification of automation framework Selenium. As Selenium gives you the full but complicated access, the Helium abstracts every function in easy to understand scripting.  It has extremely low learning curves and pretty natural to use. Similar to many other automation platforms it works with nearly every OS and browser you can imagine. Its scripts for playback can be created in a scripting language, Python or Java. Here is an example of typical script:

1

2

3

4

5

6

7

startChrome();

goTo(“facebook.com”);

write(“email”, into(“Email or Phone”));

write(“password”, into(“Password”));

click(“Log In”);

write(“Hello from Helium!”, into(“Update Status”));

click(“Post”);

Helium is quite easy to work with and works for many browers. Helium has no free offering and it is only available as commercial application.

Pros:

Extremely easy to setup and use

Supports most browsers and OSs

Tests can be scripted without any programming skills.

Cons:

No free version available

Not supports recording tests directly.

Resources

Helium HQ

Introduction to Helium

iMacros

iMacros is another proven web browser automation solution. It is mainly mainly designed for automating repetitive tasks in a browser but  it can also be used for web testing without any problems. It supports full record and playback functionality without any coding skills. iMacros supports only Internet Explorer, Firefox and Chrome for automation. Tests are recorded into a special scripting language. A sample of typical test might look like this:

 

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

VERSION BUILD=10.4.28.1074

TAB T=1

TAB CLOSEALLOTHERS

URL GOTO=http://demo.imacros.net/Automate/Extract2

TAG POS=1 TYPE=TD ATTR=CLASS:bdytxt&&TXT:* EXTRACT=TXT

TAG POS=1 TYPE=A ATTR=TXT:H*links* EXTRACT=TITLE

TAG POS=1 TYPE=SPAN ATTR=CLASS:bdytxt&&TXT:* EXTRACT=HTM

TAG POS=1 TYPE=A ATTR=TXT:HREF<SP>extracts<SP>links EXTRACT=HREF

TAG POS=1 TYPE=IMG ATTR=SRC:*shark_thumbnail.jpg EXTRACT=ALT

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=NAME:abc EXTRACT=TXT

TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=ID:TF2 EXTRACT=TXT

TAG POS=2 TYPE=TABLE ATTR=TXT:*My* EXTRACT=TXT

TAG POS=1 TYPE=TD ATTR=CLASS:bdytxt&&TXT:* EXTRACT=TXT

‘Relative extraction

‘1. Mark reference (anchor) element

TAG POS=1 TYPE=TH ATTR=TXT:MyTable

‘2. POS value is RELATIVE to the anchor element

TAG POS=R3 TYPE=TD ATTR=TXT:* EXTRACT=TXT

SAVEAS TYPE=EXTRACT FOLDER=* FILE=+_{{!NOW:yyyymmdd_hhnnss}}

It has a great recording functionality and reliable playback. Unfortunately there is no free version of  iMacros and it is only available as a commercial product.

Pros:

No programming or coding skills are required for rest recording.

It supports up to 50 browsers in parallel.

Capable of testing of plugins like Flash and Silverlight.

Cons:

No free version available .

Supports limited browsers.

Resources:

iMacros Hompage

Introduction to iMacros

Watir

Watir is used to create web tests directly in the programming language, Ruby. With the help of Watir Webdriver you can run these tests with any browser supported by the Selenium framework. It works on all popular OS’s. There no test case recorder and tests are coded directly in Ruby. A typical test case might look like this:

1

2

3

4

5

6

7

8

9

10

11

require ‘rubygems’

require ‘watir-webdriver’

 

browser = Watir::Browser.new

browser.goto ‘http://bit.ly/watir-example

 

browser.text_field(:name => ‘entry.0.single’).set ‘Watir’

 

browser.button(:name => ‘logon’).click

 

puts browser.title == ‘Thanks!’

If you have knowledge of Ruby programming language, the Ruby Watir is the best tool for you. I works great and very easy to setup and best part is that it free of cost to use.

Pros:

Supports nearly every browser and operating system combination

Open source and free of cost.

Cons:

Coding skills are required.

No test recording feature.

Resources:

Watir Homepage

 

Watir Tutorial

BrowserStage

The last tool in our list is BrowserStage. It goes into a different direction and you don’t need any coding skills to use it. It supports recording as well as playback directly in any modern browser. And even better it works all in just browser which any installation  or setup. All browsers you might want to test are available in this application and are running on its servers. You need nothing more than your web browser to for running and recording  tests. It is available only in commercial version.

Pros:

Supports nearly every operating system and browsers.

Programming skills are not required for recording tests.

No configuration or setup is required

Cons:

Not free.

Resources:

BrowserStage Homepage

Summary

So, you have seen there are quite a few possibilities for web automation to choose from. Each of the tools has a purpose and use case. If you are still unsure you can narrow down the selection depending on your requiriement and programming skills.

What is the best web automation services for you? What are you currently using and what problems do you face? Write us in the comments!

 

 

Previous PostNext Post

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Theme