Friday, April 16, 2010

Games Test Automation

I was asked lately how to automate test for games. The challenge is even bigger when the game is a Facebook application.

I test-drive SeeTest from http://experitest.com to automate FarmVille.

The FarmVille is a flash application running inside Facebook.

First you have to set the application title. I set it to ‘FarmeVille on Facebook’ (that way I will be able to execute it on Firefox as well.

image

I started by capturing few scenes:

image

When you move your mouse on the captured scenes element are automatically identify (it’s cool and very easy to work with).

image

Just place your mouse on the element and right click to extract the element.

image 

Give the element a name (in our case ‘Market’).

Following are the elements that were extracted:

image

See that when you select an element it been identified in the scene tab.

Now in addition I used some interesting feature of SeeTest called overloading. You can give the same name to elements:

image

You can see I have 2 elements with the name ‘Place to seed’. When used in the script you can just used ‘Place to seed’ and the operation will be done on the first element to be found.

Now let see how the script look like:

image

Two things I like about the script:

1. It’s graphical and very simple to use.

2. You can export your script to any programming languages like: C#, Java, Python, VB-Script, Perl…

Following is how the Java export looks like:

image

And now for the execution:

No comments:

Post a Comment