iOS mobile testing tips

6 Jun

These tips may be found elsewhere on the web already, I’m just archiving this info I put together a while back into a single repository in the form of a blog post.

Tips for both iOS devices and iOS simulator

Firebug for iOS

Set up a javascript bookmarklet to Firebug Lite, so that you can invoke the lite version of Firebug in mobile Safari on actual device or simulator. See Martin Kool’s article for details, if you don’t know how to set up javascript bookmarklets. NOTE: on simulator, you will lose the bookmark when you do an iOS “Reset Content and Settings…” command. No issue on device unless you specifically delete bookmark or do a factory reset.

View Source of a page

iOS 8+: install an iOS 8 extension like the one called View Source. There are several extensions to choose from. The View Source one may be best as most popular, well known. Or you can also choose the other option for older iOS versions.

iOS 8+, 7.1, and earlier : use this Javascript bookmarklet trick/tip, or this version called Snoopy. NOTE: on simulator, you will lose the bookmark when you do an iOS “Reset Content and Settings…” command. No issue on device unless you specifically delete bookmark or do a factory reset.

Tips for iOS simulator

Set up camera roll to be able to use photos and videos for testing

See: How to import photos into the iPhone Simulator — Aptogo. In general, drag & drop photo into simulator and then tap & hold to save image in simulator will add to camera roll for later use. See the linked article if you need to bulk import photos into simulator. NOTE: on simulator, you may lose the photos when you do an iOS “Reset Content and Settings…” command. No issue on device unless you specifically delete photo or do a factory reset.

For videos, instead of photos, see How do I get video into the iPhone simulator camera roll in iOS 4.2? – Stack Overflow. NOTE: on simulator, you may lose the videos when you do an iOS “Reset Content and Settings…” command. No issue on device unless you specifically delete video or do a factory reset.

Tips for iOS devices

Debugging mobile and tablet websites on iOS – on Windows or locally on device

Tips on mobile and tablet device testing shared usage and remote testing outside corporate network

Sharing bookmarks and photos across devices

If you use an Apple/iCloud account across the devices (This might work on simulator iOS 7/7.1+ if you sign in to iCloud from simulator and then do a Debug > Trigger iCloud sync, although I haven’t tested it):

The photos on each device (if not existing photos, then new photos taken) will be accessible across devices via the Photo Stream section of Photos app. And deleting photo locally in camera roll of a device won’t delete it from the Photo Stream (for that device and all other shared iOS devices), so you have to specifically delete from Photo Stream to delete across devices, the camera roll is treated separately from Photo Stream on each device, so you will notice copies of what you have locally on camera roll also in the Photo Stream that’s available across devices. NOTE: that the Photo Stream (for iOS 6-7.x) is temporary storage, and to make it permanent on each device, you have to save it to local system (device/simulator) before it expires in 30 days (I forget, but the system may copy the photos you’ve previewed to your device after expiration rather than let it disappear from the stream). The iCloud Photo library in iOS 8 is different though with it being permanent storage.

Creating a bookmark on one device will automatically sync (if enabled, by default) them to the other devices using same account, so you don’t have to set up bookmarks/bookmarklets individually on each device.

Recording actions against or test session of iOS physical device into a video

For iOS 8+ only, but see Record your iOS Test Session with QuickTime | Daniel Knott

Tips for simulating iOS device in browser via user agents, etc.

Device screen sizes for testing mobile and tablet views of a site and user agent tools

Tips on mobile and tablet device testing shared usage and remote testing outside corporate network

6 Jun

Here’s some useful tips for development and QA testing of websites or apps on mobile/tablet devices, if you didn’t already know.

Tip on wireless network login (accounts) when sharing between people

This tip is for those who use a corporate wireless network that has user accounts per person without a common shared account (or guest access to internal resources).

Rather than ask the previous user for their network login password if/when prompted by the (iOS) device, here’s how to resolve that issue of sharing between users. The tip here is specific to iOS but should be similar for Android, Windows Phone, Windows, Mac, etc.

Option 1 – login with your own network login

You only need to do this if ever prompted to login with only a password (or prefilled username) rather than the whole username & password.

  1. Clear the cached user login info.
    1. Settings > Wi-Fi > find network (name), tap the wifi network’s settings/properties icon (a blue circled arrow on iOS 6, an “i” circled tooltip on iOS 7).
    2. Choose Forget this Network
  2. Find the network (name) again in wifi settings
  3. Select that network. You’ll now be prompted for the login username & password, and not just a password to cached login
  4. If you don’t like “your” login cached, then “forget” the network after using the device.

Option 2 – use other available network but then connect to internal network

This method won’t require you to keep swapping user logins when device shared between people. This only works if you have a wireless access for guests (that perhaps only grants access to internet and some internal resources but not all), or some public wireless access but not corporate wireless access.

  1. Connect to the guest or public wireless network
  2. Connect to internal network using VPN app on the mobile/tablet/device
  3. Disconnect VPN when done testing

Tips on remote testing at home or outside local network

When you’re at home or outside the local network, you don’t have access to internal resources. Here’s some options.

Option 1 – device VPN

Use VPN on the device to connect internally.

Option 2 – shared computer VPN

Use VPN on your computer and route network requests from device through a proxy server running on your computer, assuming both computer & device are on same network. This method allows you to share VPN from computer to device.

Tips on remote debugging of mobile, tablet devices

For Windows, see Debugging mobile and tablet websites on iOS – on Windows or locally on device

For Mac, search the web for iOS remote debugging for details.

Device screen sizes for testing mobile and tablet views of a site and user agent tools

6 Jun

These tips may be found elsewhere on the web already, I’m just archiving this info I put together a while back into a single repository in the form of a blog post.

Table quick reference for device screen sizes

Device Type Screen Size (width x height, in portrait view, landscape = swapped values)
Old iPhones up to iPhone 4S 320×480
iPhone 5 series 320×568
iPhone 6 375×667
iPhone 6+ 414×736
iPad (any model so far) 768×1024

 

Online references for these screen sizes:

CSS Media Queries for iPads & iPhones | Stephen Gilbert

http://www.emailonacid.com/blog/details/C4/adapt_your_media_queries_for_apples_new_iphone_6_and_6

css3 – iPhone 6 and 6 Plus Media Queries – Stack Overflow

Some desktop browser tools to assist with testing mobile and tablet views of a website (there are more you can lookup yourself)

User-Agent Switcher for Chrome – Chrome Web Store

Window Resizer – Chrome Web Store

User Agent Switcher :: Add-ons for Firefox

Firesizer :: Add-ons for Firefox

Safari has bulit in user agent switcher between iPhone, iPad, and normal Safari desktop. Not sure about resizing window to match user agent though.

Complex test scenario example to truly evaluate test frameworks?

6 Jun

This came to mind in a discussion I read a while back, so thought I’d mention it. Not sure if I already mentioned it or not. But the general way we evaluate test frameworks, is rather simple. Or supposedly our system/application is not so complex to test after all, at least in terms of interactions among different component types, which themselves need to be UI/functional/user acceptance tested. For example, these days, most systems to test involve a website front end and mobile app client front ends, both of which talk to a server back end. And the website and mobile app clients don’t often need testing where they interact with each other (or rather say you test something on one client and verify on the other for example). Instead we simply test them standalone, independent of each other (or maybe mock the other side). And/or we got lucky in that it happens that the different clients (web, mobile) happen to be able to use the same platform (e.g. Java, Selenium-API) so that we can use the same framework to test them.

But truly testing the capabilities of a test framework is when you have a complex scenario that involves multiple components that need to be tested in integration (whether you mock them or not), and for the sake of simplicity in this argument, let’s say if you had to mock them, you mock them in the same language as the original component (not mocking to the platform of the desired test framework, etc.). Thus in a truly complex scenario/world, you won’t be able to have all things in Java, .NET, or whatever.

One example showcasing testing a system that comprised of the following components would be ideal: a website or web application/client, an iOS mobile app client, an Android mobile app client, a desktop GUI client, a SIP/VoIP client, perhaps a terminal/console client talking to server back end, perhaps networking communication w/ server on backend (some type of TCP/IP or other network communication), REST API web services utilized by the web/mobile/desktop clients, some native Java/.NET/etc. APIs to call. And let’s assume each of these components are built with different technology stacks and/or the tools to test them (not the framework) use different technology stacks.

Such scenarios may void certain test frameworks out of the box, unless one doesn’t mind writing custom glue logic to bind the different testing (components, tools) together within the single test framework. But a few frameworks do have better support built-in that allow you to integrate different tech stacks and tools to the framework, granted it’s not necessarily plug & play, but it minimizes the amount of effort in glue logic to integrate. I’ll leave it as an open thought on what frameworks are useful for such complex scenarios and which aren’t so much.

What the f**k to test?

23 Feb

Was reading my emails and some blog posts today and came across these:

http://lifehacker.com/5911385/seven-helpful-sites-that-tell-you-what-the-fk-to-do

https://github.com/soulwire/WTFEngine

it made me think, as a tester, it would be interesting to have/see a site about “What the f**k to test” or something similar. It could be useful to the entry level and novice testers just getting into testing profession. And it could be useful to all of us testers when we happen to feel lazy or have “tester’s block” not being able to test or decide how/what to test.

Or do we actually have something like that already? If so, let me know.

If not, anyone interested in helping build such a site/service? It would be a site that randomly decides to give you the tester a tip on what to test for your site/application/system (in general terms that are not specific to your site/application/system).

Chrome version upgrade can break Chrome extensions?

28 Jan

This is a short blog post today:

Who would have thought this, but some recent Chrome version upgrade can break the UI of your Chrome extension (by changing extension popup window size and font sizes). I only found out after reading a user review.

For reference to the particular issue: https://code.google.com/p/autosmsclients/issues/detail?id=3

and now I have to find time to go debug and fix this, just because Chrome decided it wanted to change things on how a Chrome toolbar UI renders, and without notifying it’s extension developers about this…sigh…

Integrating AutoIt, Sikuli, and other tools with Selenium when running tests in Selenium Grid

22 Jan

A true integration for tools like AutoIt, Sikuli, etc. with Selenium would be when they are able to run under Selenium Grid configuration just like Selenium. That would probably first require that they can run over WebDriver API, JSONWireProtocol as with AutoItDriverServer. But when Grid automatically selects which node to run your Selenium tests with, would it not do the same for AutoIt, except if you specifically request a certain capability set that let’s you know which exact node the test will go to. But anyhow, it might get confusing how to map/correlate which grid node runs the Selenium part of test vs the AutoIt/Sikuli part, etc. So maybe having AutoIt/Sikuli run under Grid configuration isn’t the whole answer either.

Regardless if AutoIt/Sikuli ran under Grid configuration or not, you could still deploy your Selenium tests that use AutoIt/Sikuli, etc. under Grid. I did blog about this a while back but never gave concrete examples. In StackOverflow tradition, people seem to want specific examples. So I’ve finally worked up a simple illustrative example.

To have AutoIt/Sikuli work with Selenium while it’s running under grid mode, you need to find a way to determine the node host that runs the Selenium tests at runtime, so that you can then call/run AutoIt/Sikuli code on the same target node host, so that everything runs on the same correct machine (rather than the dilemma novices encounter where Selenium executes on the remote node but AutoIt/Sikuli runs on the localhost, causing mismatch and test fails).

The easiest example solution is to extract out the node host information from the Selenium Grid API by providing the WebDriver session ID that you first need to extract. Once you have that information, you can then use various ways to remotely execute AutoIt, Sikuli against the node host that you’ve extracted. All this is presented in this Github gist:

https://gist.github.com/daluu/3b4746f6b672c49f7e8f

of all the various ways in the sample gist, I personally prefer calling AutoIt, Sikuli over WebDriver API, where possible rather than to resort to using PSExec.exe, SSH, etc. I’d go for web service route as alternative to WebDriver API. Sticking with PSExec.exe type option as last resort. But you are free to pick whichever option works best for you.

techno milk

the nourishing bits

Thomas Sundberg

Software Developer, Speaker, Teacher, Mentor, Leader - notes and thoughts

Coffee Spoons of Code

A Programming Blog

Ivo Nascimento

this is a blog related with my job as System Analyst

Punynari's Island Adventures

An adventure blog focused on Japan and Hawaii

Juhu Kinners

JavaScript - one language to rule them all

The Zen of Software Testing

VALIDATE| AUTOMATE | INNOVATE

Seven hours behind.

Andy & Tiffanie's journey to code enlightenment

IT is a Techie's World

A space where Techies attain Nirvana...

Smart Techie

My Thoughts, My Work, My Ideas

行云朵朵

Life is about memories....

GrowingOnUp

I'm growing up. It's a quick and painful process but I know I'm not alone. I write in the interests of transparency and solidarity.

Fijiaaron

Testing around the world

Mary Ann M-P's Blog

Selenium: My Take

Let's BDD PHP

Just another WordPress.com site

muthutechno

All about coding!

Watir WebDriver

the most elegant way to use webdriver with ruby

rafazzevedo

Automated Tests and other stuffs

Follow

Get every new post delivered to your Inbox.

Join 75 other followers