Archive | Testing RSS feed for this section

Network (HTTP, etc.) packet capture setup across different client devices

21 Dec

General methods across all devices

These methods should work for all devices, for most use cases, and can be used when you can’t directly capture traffic from the device itself (unlike laptops, desktop computers).

Proxy client traffic to a host that can do packet capture

  1. Have a host machine like your Mac/Windows/etc. laptop to do the capture, using wireshark/tshark/ tcpdump.
  2. Use/install a proxy server on the host machine (e.g. Charles proxy on Mac, Fiddler on Windows).
  3. Follow the proxy instructions to install the proxy’s SSL certificate to your client devices under test (in case you need to capture/decrypt SSL/HTTPS/WSS traffic).
  4. Route/enable the client device’s (wifi) network connection to use an (HTTP) proxy, entering the values for your given proxy (the defaults or your own customized values you set on the proxy server).
  5. Start proxy server on host machine.
  6. Start capture on host machine.
  7. Generate the desired traffic activity on client device.
  8. Stop capture on host machine.
  9. Stop proxy server on host machine.
  10. Disable/unroute client device network traffic over the proxy.

NOTE: this probably only works provided the client traffic is based on HTTP/HTTPS/WS/WSS, where the capture will also capture the TCP/UDP packets. Not sure if it goes through other protocols whether this will work. Although most mobile devices use HTTP/HTTPS anyhow.

Shared/open network sniffing/capture

With this setup, you have a host machine like your Mac/Windows/etc. laptop or some server or Raspberri Pi to do the capture, using wireshark/tshark/ tcpdump. This host resides on a network where traffic is broadcast on all the ports (e.g. use of hub instead of switch and router, etc. at the lowest leaf level of the network where the testbed is set up) and thus said desired traffic is available to the host machine to sniff & capture.

For this simply ensure the target client to capture is in some way connected to this open sniffing/capture network, and then you can do the capture at any time as desired.

If the clients are wireless, that means the access point has to be connected to this open sniffing/capture LAN to capture the traffic.

Device specific traffic capture

iOS traffic capture

To save hassle of dealing iOS device UUID (finding it with XCode/iTunes, and then making use of it), use the script from here to wrap the process for you: https://thrysoee.dk/iospcap/.

Once that is done and the tool is started to allow capture for (USB) attached iOS device, simply use the interface(s) rviN, where N is a number starting from 0 (typically rvi0 for single device), with the capture tool (Wireshark, tshark, tcpdump). Follow the tool commands to stop the interface service after done capturing.

NOTE: this method is only for use with a Mac. For Windows, Linux, you might first need to install some software to be able to do this: https://github.com/gh2o/rvi_captureConnect your account to preview links.

Android traffic capture

There can be multiple options for traffic capture here, more especially if the client device is rooted. However, we’ll go with the simplest approach at the moment:

Use tPacketCapture app from Google Play Store.

To use the app for capture:

  1. Open the app.
  2. Click Capture button. Button name should change to Running, and a key-like icon will then show up in the upper/top left corner of the status bar of the device, for access to stop/disconnect the capturing.
  3. Note the filename for this capture listed under “Current File” section, for reference.
  4. Generate the desired traffic activity on client device.
  5. Stop the capture by accessing the key-like icon at upper/top left corner of device.
    1. in the popup that appears choose disconnect (or equivalent) option.
    2. optionally kill the app to save resources, and kill whatever other apps were used for generating traffic to capture.
  6. Transfer the capture file from the device to a computer for further analysis and permanent storage if desired.
    • can transfer over USB cable connection, using like Android File Transfer tool on Mac, or equivalent on Windows (which should have native file storage access over Windows Explorer).
    • can transfer over NFC
    • The capture files can be found under a path like (internal storage of Android device)/Android/data/jp.co.taosoftware.android.packetcapture/files/YYYY_MM_DD_HHMMSS.pcap.
    • you can optionally delete the files from the device afterwards to save space & for less cluster/confusion.

Awesome Stuff – Selenium, RobotFramework, test automation, etc.

24 Feb

A while back I came across the “awesome” series of listings of (good?) resources for a given category (awesome go/java/ruby/python/etc.).

Well, it’s nice that it has expanded to other areas beyond programming languages, and per se to my original blog content, some areas I and my readers are interested in that I thought to share (if you haven’t already come across them):

I’m contributing to these as I can. And we all should, but at the same time, in keeping with the motto “awesome”, entries in the list should have good reason to be there, not just “yet another related thing to put on the list”, should be something special, otherwise, it will end up a bloated list of (spam-y) stuff.

On filing bugs to Apple

26 Aug

Unlike other public bug tracking systems, Apple’s one is closed to public viewing other than Apple and the reporter of the bug.

So bugs you report, others can’t see the status of. And as such, there can be likelihood of duplicate bugs being filed, etc. I assume Apple has good reasons to overlook potential duplicate bugs in favor of this closed access bug tracking system.

Amusingly, a public repository of Apple bugs is available at OpenRadar. It’s useful for the public community to look for existing bugs filed to Apple before filing their own, and check status of said bugs. There is one caveat though, OpenRadar does not pull data from Apple’s system. Therefore to get data into OpenRadar, one must file a “duplicate” bug to it for whatever one files to Apple.

As such, I would recommend those of us who deal with Apple bugs to:

  1. Check OpenRadar first before filing bug to Apple. If one exists on OpenRadar, just subscribe to and monitor that. Although one is free to file a duplicate to Apple just in case.
  2. If one doesn’t exist on OpenRadar, then file bug to Apple. And if the bug is not specific to your internal case (confidential/security/proprietary info, intellectual property, etc.), post a duplicate filing on OpenRadar. This allows the public to see the bug you filed. Also makes it easier for team members to view the bug for those teams that don’t use a shared/team Apple developer account or whose said accounts aren’t all under the same organization access. NOTE: that if you file a duplicate post on OpenRadar, do try to keep it updated or in sync with changes/updates on the official bug you have with Apple, so the public knows the status of it.

UI test automation of virtual app/browser delivery to local desktop

7 Jul

This thought just came to mind as I read through forum posts recently regarding automation scenarios like the following:

  • a web app or site is delivered to the user via a browser presented within a browser. e.g. via Citrix virtualization solutions delivered over a browser for desktop & browser-based apps.
  • a web or desktop app delivered to the user remotely via virtualization but made to feel as if it was installed, running, and deployed locally on the local machine, delivered via tools like MS Application Virtualization Client, Citrix, etc.

How do we test for these apps/cases, particularly say if we wanted to test against the exact deployment setup of how they are used? It would seem from the current infrastructure, this is likely a manual testing activity. And for automated testing, we are relegated to simplifying the test setup and assuming the simplified setup will behave the same as actual deployment, and just cover any differences with manual testing.

I bring this up as I know not of any existing automation solutions, commercial or free/open source, but particularly the latter, where these kinds of special deployment setups are supported for automation testing. As these deployments are delivered through virtualization technology, unless the test automation tools are integrated in that virtualization delivery (e.g. hosted and running in the same context as the app that’s delivered over virtualization rather than locally on the client receiving the virtualized app), the test tools won’t be able to detect and automate the virtual app. That integration is likely not feasible or easy to do due to platform isolation and security restrictions and sandboxing. It’s not quite the same as just running everything (the app under test & the automation tools) on a remote host and accessing it via remote desktop/VNC to see it in action.

Perhaps this isn’t much a concern for the community/industry until more and more people use this type of app delivery infrastructure where it is ubiquitous like mobile devices/apps are today. Still, something to ponder about for the future of testing. Wonder what is to come in this space for test automation. Or have I just been ignorant and we already have some tooling for this today?

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.

Tips on HAR file capture on mobile/tablet devices

For iOS: https://github.com/andydavies/ios-har-builder

For Chrome mobile (Android)?: https://github.com/cyrus-and/chrome-har-capturer

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.

Sue Connelly's KIT List Blog

Job Search and Career Management Tips and Strategies

The Networker

Bassem Aly

WiFiTodd

802.11

xlcwu's Blog

Lifestyle, Computer, Ubuntu, Linux, Apple, Mac, iPhone, Game, Programming, Java, C, ObjC and More ...

Multiple States Knowledge Base

Multiple States is a digital design, development and content creation studio, specialising in beautiful, clean and functional websites with powerful content.

journey of quality

make it perfect!

Marc Guillemot's blog

Java, Groovy, HtmlUnit, WebTest, NekoHTML and more. Contact me for rates.

North American Sea Glass Association official website

NASGA is a non-profit organization positively supporting sea glass collectors and the sea glass community with festivals, information, educational opportunities, commercial membership and more. The primary goal of NASGA is to establish a community of informed collectors and sellers of sea glass that are educated on the characteristics and significance of genuine sea glass.

Abiral Shakya's Blog

Learning, Improving and Sharing

Tea in Eighteenth-Century Britain

History of Tea Project at Queen Mary University of London

Phimosis - A Simple Cure (That is working for me)

No nonsense, no adverts, no sales pitch, just honest information.

Glass Onion Blog

Cheat sheets, post-its and random notes from the desk of a programmer

Abode QA

A Hub For Testing Minds...

The Test Therapist

Performance & Security Testing Blog

chrysohous

a programmer's hub

Let's Not Crash and Burn

it makes your brain tingle

Perform

“Incinerate Ignorance”

Anastasia Writes

politics, engineering, parenting, relevant things over coffee.

One Software Tester

Trying To Make Sense Of The World, One Test At A Time