Sep 12, 2014

Using Sikuli to test Windows Phone 8.1 Application

Test automation tools for regression testing in mobile applications have been increasingly sought. For some platforms is very difficult to find good free tools such as Windows Phone 8.1 platform. To automate this platform effectively you need to invest in expensive testing tools. But if your company doesn't have budget to invest in the purchase of tools for test automation, It is possib;e to perform a feasible way to automate using a free tool called Sikuli.

Sikuli is a free tool picture driven developed by MIT using python programming language. This tool allow to automate regression tests, you can find the tutorials and presetations in the sikuli web site.

The requirements to use Sikuli to test windows phone are:

  1. Use a computer with S.O. Windows 8.1
  2. Download and install Sikuli in your computer.
  3. Download and Install Project my Screen for Windows Phone available on microsoft page ->
  4. Connect your mobile device Windows Phone 8.1 and project the screen on your computer. Example of how to project the screen here.
Steps to automate tests using Sikuli:

  1. Open the Project My Screen and plug your Mobile Phone Windows Phone 8.1 by USB port.
  2. The Mobile Phone' home screen must to appears ins your computer. 
  3. Open Sikuli program in your computer.
  4. The Sikuli IDE must be opened as showed in Figure 1.
  5. The left bar shows the commands to be used in Sikuli.
  6. Click on command "Click()"
  7. Now Select the area of the screen of your Mobile Phone . For example, select the icon of your application (To open the application to be tested).
  8. The sikuli will script the command with the image selected. Click (image)
  9. Now you tap on icon of your mobile application to open it.
  10. Then, back to Sikuli and choose the command Click() again.
  11. Select the application area, for example a button.
  12. Tap on button select in your mobile phone.
  13. In Sikuli, you can click on command Find() 
  14. Select an image of your mobile application or a message for example.
  15. Go to your mobile initial state, for example home screen.
  16. In Sikuli click on button Play to reproduce your steps and observe it executing.

Figure 1 - Sikuli IDE

The video attached will shows how the steps recorded can be reproduced using sikuli.

  • The Project my screen must be opened in the same size and position in your computer to be exactly reproduced.
  • The home screen of your mobile phone and localization of icons and image must be the same of the mobile recorded.
  • The Sikuli will recognize the application through the image and position.
  • You can use python language to improve your test script , example: 
if find(image)

    print "Test Passed"

else print "Test Failed"