Mobile Devices (RWD applied)

Background:

So far we have talked about resizing windows and overriding user agents in the browser to emulate behavior of various resolutions. So how is this helpful for us to do RWD test Automation on mobile devices?

Well there are insanely large # of permutations and combinations one would have to test on mobile devices, because it is the combination of (useragent,coordinates) that emulate/simulate a mobile web browser. And better, the parameters keep changing as new versions get released. By that I mean useragent and/or dimensions/pixel/resolution keeps changing.

So how do we go about?

I would say that it is not possible to specify every permutation and combination and test them. However, if you are able to identify your device’s “user-agent” string and resolution (x,y), then we definitely have a way. Well, you might ask where do I get those values. Thankfully there are enough # of forums or official Apple or Google sites that specify those parameters if you search for them

For example, Google publishes the user-agent information here

This website publishes for iphone and ipad

So essentially, you would have to identify the below two parameter values viz.

  • user-agent stringĀ 
  • Window width and height (aka. resolution)
  • orientation (and resolution thereof)

Once you have these values for the devices feel free to use the below code.

Entire Cucumber Scenario

Step Definitions