Wednesday, August 17, 2011

Native android app automation – Nativedriver vs Robonium

Nowadays android is the latest thing in the market and many of the companies are working on android app development. With development comes the requirement to test an application too. As we all tester know that automation is one of the important part of testing, and is mainly used to reduce the time taken to execute the testcases. This gives time to testers to concentrate more on exploratory testing. Recently I was going through some group, and found out about some open-source frameworks that makes it possible to automate an Android native application. I went through two of such frameworks and will write about what I felt about them. The two frameworks I am going to talk about is Nativedriver and Robonium. 

Nativerdriver- Is an opensource framework written over Selenium-2.0 Webdriver implementation. As we all know that selenium is a great functional automation tool for web-applications and gives you a cross-browser and cross-platform supports. The support for testing native application has enhanced the value of selenium. Nativedriver can be used when you are actually working along with the development team and has access to the source code of the andorid application that needs to be tested. 

Robonium – Is also a great tool and is written by extending the Internal Android testing framework. This framwork supports a lot of functions which can be used to auotmate your application test. The main advantage of this framework is that , you can automate any application using this without actully having the source code of the app.

Advantages of Nativedriver: 
  • Built over the selenium webdriver hence can be easliy used by existing selenium users.
  • Test are run as a normal Java unit test. And hence other frameworks can also be used for test-case execution or reporting.
  • Ant or maven can also be used for execution of cases.
  • Fast execution and reporting of testing results
Disadvantages of Nativedriver:
  • Need access to the source code of the application that needs to be tested.
  • Sometime difficult to find element as support for finding elements by index is not available

Advantages of Robonium: 
  • Don't require the source code of the application for testing.
  • Elements are easy to identify and work on.
  • Tests are simple to write.
  • Setup is simple.
Disadvantages of Robonium
  • Can only be executed suing eclipse.
  • Slow execution.
  • Typing a normal text is not supported at this point.

4 comments :

Priya said...

Hi Varun,
I am testing the mobile version of web site on Firefox using user agents and modify headers. While automating this, I am able to access/modify the user agents from the code(java using eclipse). But I am unable to modify/edit the modify headers. Do we have a work around to access modify headers from code? Thank you.

Varun Menon said...

@Priya: Sorry but I haven't worked on web based testing for mobiles or mobile pages.

Anonymous said...

Hi varun,

I am working on Selenium Native driver for AndroidHybrid application(Which does not contain layout).
Please let me know whether it is possible to write testcases using xpath or id's like Webdriver testcases.Because the Android Hybrid application does not contains any xml it just access the url which is running in somewhere so it will not have R.java .

Varun Menon said...

Using NativeDriver you cannot do that. NativeDriver is an extension of Selenium webdriver and is only for native android applications.
You need to write your own extensions to take actions on WebView.

Post a Comment