Friday, December 11, 2015

QA Tools Part 2 - Stress Testing Mobile Apps

UI/Application Exerciser Monkey


Monkey is a program that runs on device and generates events such as clicks, touches or gestures. Monkey can be used to stress test applications.
For using monkey you need to install the ADB from Android SDK. ADB is the Android Debug Bridge which communicates with emulators and Android powered devices. You will find the adb under sdk > Platform tools.
Before running monkey, you need to get the package name so that your monkey stress test is run only on the AUT. For this we need to use Android Asset Packaging tool. You will find AAPT under sdk > build tools > 21.1.2 – aapt.exe
For pulling out the package name we need to use in cmd after redirecting to the path of the AAPT:
aapt d badging <File name>
This will give the package name along with other details

d -->  dump
badging --> prints the label and the icon for the app declared in the apk

Once package name is available execute monkey with adb:
adb shell monkey –p <package name> -v <event count>

p --> will run monkey test only on the specified package
v --> will make the results of the monkey test more verbose
s--> seed, will ensure that the same events are triggered next time so it’s easier to reproduce.

 



UI AutoMonkey


UI AutoMonkey is a simple stress testing tool for iOS applications. You can test on your app with a barrage of events like taps, swipes, device rotation.
For using UI AutoMonkey you need a mac machine with Xcode installed.
  1. Then you need to open the xcodeproject of the app from Xcode
  2. Profile > Products, build your application
  3. This will launch the app in simulator and also launch the Instruments template picker
  4. Select UI automation template
  5. Copy paste the js file in scripts
  6. Download it from here: https://github.com/jonathanpenn/ui-auto-monkey/blob/master/UIAutoMonkey.js
  7. At the top of the script, you'll see a JavaScript dictionary of configuration settings:
config: {
  numberOfEvents: 1000,
  delayBetweenEvents: 0.05,    // In seconds

  // Events are triggered based on the relative weights here.
  // The event with this highest number gets triggered the most.
  eventWeights: {
    tap: 30,
    drag: 1,
    flick: 1,
    orientation: 1,
    clickVolumeUp: 1,
    clickVolumeDown: 1,
    lock: 1,
    pinchClose: 10,
    pinchOpen: 10,
    shake: 1
  },

  // Probability that touch events will have these different properties
  touchProbability: {
    multipleTaps: 0.05,
    multipleTouches: 0.05,
    longPress: 0.05
  }
},

  1. Hit play from bottom of the Instruments window to start the script
  2. It will execute the stress test on the app on the simulator
You can configure the config file as per requirement.

Android Screen Recording using ADB


Screenrecord is a shell utility for recording display of a device. The utility records the screen in an MPEG-4 file.
adb shell screenrecord /sdcard/probwithlogin.mp4
Stop the screen recording by ctrl+c, max time limit is 3 minutes or timelimit set by –time—limit. The tool is recording the video in native display resolution and orientation.
Some points to consider:
  • This will work on Android 4.4 +
  • Audio is not recorded with video file

24 comments:

  1. You truly did more than visitors’ expectations. Thank you for rendering these helpful, trusted, edifying and also cool thoughts on the topic to Kate. digital marketing jobs career opportunities in abroad
    Advance Digital Marketing Training in chennai– 100% Job Guarantee

    ReplyDelete
  2. Great post! I am actually getting ready to across this information, It’s very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.


    rpa training in Chennai | rpa training in velachery

    rpa training in tambaram | rpa training in sholinganallur

    ReplyDelete
  3. Woah this blog is wonderful i like studying your posts. Keep up the great work! You understand, lots of persons are hunting around for this info, you could help them greatly.
    python training in chennai
    python training in Bangalore

    ReplyDelete
  4. Wonderful article, very useful and well explanation. Your post is extremely incredible. I will refer this to my candidates...
    Java training in Chennai

    Selenium training in Chennai

    ReplyDelete
  5. She noticed a wide variety of pieces, with the inclusion of what it is like to have an awesome helping style to have the rest without hassle grasp some grueling matters.
    fire and safety course in chennai

    ReplyDelete
  6. Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here.
    AWS training in Chennai

    AWS Online Training in Chennai

    AWS training in Bangalore

    AWS training in Hyderabad

    AWS training in Coimbatore

    AWS training


    ReplyDelete

  7. Thanks for the Valuable information.Really useful information. Thank you so much for sharing. It will help everyone.

    SASVBA Delhi provides extensive MERN stack training in Delhi. The extensive hands-on session, hosted by the MERN Stack Training Institute in Delhi, includes live projects and simulations.

    FOR MORE INFO:

    ReplyDelete
  8. https://evilqa.blogspot.com/2015/12/qa-tools-part-2-stress-testing-mobile.html?showComment=1601294649697#c330578282691095883

    ReplyDelete