Our blog

Mobile Web Application Test Automation-II

Read Part 1 for the introduction to the mobile web application test automation.

Mobile browsers have come a long way from being very basic browsers that displayed only static browsers to the present day advanced browsers that are virtually as equipped as the regular browsers. Mobile Websites rendering full blown content came hand in hand with the advancement in Mobile Browser Technology and the same brought in demand for high end mobile browser testing. But it was very impractical to test such stuff on hundred of handheld devices. It was the need of the hour for tools that would simulate a mobile browser type environment on the regular browser. Of course there were simulator tools, but each OEM had their own tool with limited functionalities.

There are multiple approaches to test web application

1. Actual Device
– Testing on it could be more perfect and effective, but on the other side, you must need to have large number of device lab or need subscription for this lab.
– It is also time consuming to check your test on each and every device manually.
One can perform automation for all those device and run script but you need subscription for those device lab for that.

2. Simulation
– In this case, you treat your browser as device and apply simulation for different phone
– This become cost-effective approach
– On the the other hand, this is simulation and not actual device, sometimes ajax, javascript which made to work for phone will not work for browser simulation

Let’s look at simulation approach.The question is how would simulation work. How would a web browser camouflage itself to appear as a mobile browser. The answer to that is user-agent headers/profile.

Each mobile device contains certain information which identify one phone behavior from other. That unique information is mentioned and explained below.

1. Accept : Contains list of MIME types accepted by user agent
2. User-Agent: Contains information used to identify device and detailed information for that device. Below is example of user-agent string and each of its artifacts.

A sample iPhone User Agent String and its understanding is mentioned below.

Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3

Mozilla                                           :   It’s a Mozilla based browser
5.0                                                       :    The version of the browser
iPhone                                           :    Apple iPhone
U                                                             :    Security Value. U denotes Strong Security
CPU like Mac OSX          :   Operation System iPhone OS based on Mac OS X
en                                                           :   Localized language for the Browser English
Apple Webkit                       :   A set of core classes to display web content
420                                                     :   Version of the Webkit build
KHTML                                        :   KHTML Engine like Gecko
Version                                       :   Safari Version 3.0
Mobile                                           :   Mobile Device
1A543                                           :   a iPhone Firmware Version
Safari                                             :   Name of the browser
419.3                                               :   Browser Build

3. User-Agent Profile: User-Agent Profile is an xml document which describe device capabilities e.g screensize

All above user-agent headers and user-agent profile will change the browser behavior to mobile behavior.

Certain tools are available which changes user-agent header/Profile and simulate a similar environment on a different browser. Such tools help a lot in multiple environment mobile testing. Bayden UA Pick, Fiddler, etc are examples of such tools.

In next part of our article, you can find, detailed information about some simulation tools for IE and Firefox.

Interested in our Testing Services?

Contact Apexon +1 408-727-1100

By submitting this form, you agree that you have read and understand Apexon’s Terms and Conditions. You can opt-out of communications at any time. We respect your privacy.

Other stories you may enjoy...

Healthcare Apps and the Need for Security

One of the most exciting areas in tech right now promises to be “the most personal” ever. A key aspect of making wearable devices like the Apple Watch personal is through...

Developing an App for the 2020 General Election?

Here is a thought: With the UK General Election having just finished, could the next one in 2020 be the first to use a mobile app to allow people to vote? The polling...

Be honest. Describe the state of your test cases.

“There’s some dead wood in there.” “Hmmm…. Someone really needs to clean them up.” “A little outdated.” For those reading this in the northern hemisphere,...