GUI testing and fitnesse

I like the definition of fitnesse as the respect of test case management tool. It is quite diverse from the official definition is the acceptance automation tool. Fitnesse is know as unfit for testing GUI. I had agreed this idea before I met the pyWinAuto which is a python module supporting simulation of user input, like mouse click and key in.

Convergence of pyfit and pyWinAuto makes it possible to integrate fitnesse and GUI testing. The process is like this;

1. Installing Fitnesse
 - download from here the lastest version.
 - if you don't have jre 1.5 or later, you can download it from Java web site.
 - unzip the fitnesse(fitnesse20081115.zip ) to a specific folder, i.e. c:\fitnesse

2. Installing Python
 - download from here the lastest version for Windows installer.
 - run the installer. default installation folder can be c:\python26
 - you should append  the environment variable PATH the path of python, i.e. c:\python26.

3. Installing pyfit
 - pyfit is the fit server and libraries of the porting to python language, By this we can use python on the Fitnesse.
 - download from here. PyFIT-0.8a2.zip
 - unzip it into specific folder.
 - type python setup.py install in dos window
 - PyFit-0.8a2 version setup.py need to edit for avoiding some errors, by comment out the lines on 'filter'

4. Installing pyWinAuto
 - download from here.
 - unzip it into specific folder.
 - type python setup.py install in dos window

5. Start up Fitnesse
 - cd c:\fitnesse
 - run.bat
 when the port 80 is using by other process, you can set your port to use by fitnesse like this;
 run.bat -p 8080

6. Make a pyfit testing page
  a.  Edit wiki page

!define COMMAND_PATTERN {python "%m" %p}
!define TEST_RUNNER {C:\Python26\Lib\site-packages\fit\FitServer.py}
|eg.Division|
|numerator|denominator|quotient?|
|10|5|2|
|10|2|5.001|

 b. select 'Properties', check the test checkbox and save the properties, then the test button is shown.
 c. click the test button after then if you find like this result you are right.
eg.Division
numerator denominator quotient?
10 5 2
10 2 5.001 expected
5.0 actual


7. Write a python fixture code

from fit.ColumnFixture import ColumnFixture
from pywinauto import application

class Notepad(ColumnFixture):
    _typeDict={
        "openReplace": "String"
        }
    def openReplace(self):
        app = application.Application.start("notepad")
        app.notepad.MenuSelect("Edit->Replace")
        return "success"

This code runs the notepad and select the replace menu.
Save this code at the python fit folder i.e. C:\Python26\Lib\site-packages\fit\eg\Notepad.py

8. Write a wiki page for run GUI testing

|eg.Notepad|
|openReplace?|
|success|

 change the properties to test menu enable.

9. run the test, you can see the Notepad has run and the replace  menu has selected.

Any question? Leave your comment below.

Is that so exciting?

 

이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by choipd

2008/11/25 05:59 2008/11/25 05:59
,
Response
No Trackback , 2 Comments
RSS :
http://choipd.net/tc/rss/response/33

Trackback URL : 이 글에는 트랙백을 보낼 수 없습니다

Comments List

  1. Srikanth 2009/02/25 20:35 # M/D Reply Permalink

    Hi choipd,

    Interesting article, I am working on FitNesse automation tool to automate our Regression test suite using Java Fixture.
    i would like to know one thing, is it possible to Integrate TestLink (test management tool) with FitNesse (Wiki) to execute the test cases directly from the TestLink.
    I really appreciate your help.
    -Thanks
    Srikanth

  2. Srikanth 2009/02/25 20:36 # M/D Reply Permalink

    my email id: kskanth.reddy@yahoo.co.in

Leave a comment
[Login][OpenID?]
« Previous : 1 : 2 : 3 : 4 : 5 : 6 : ... 26 : Next »

블로그 이미지

Life is too short to be complex. Choipd! Simplify your life to serve your neighborhood. I am a software engineer in beautiful city Seoul, Korea. I just leave my trace of life in this blog.

- choipd

Archives

Calendar

«   2010/09   »
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Site Stats

Total hits:
54654
Today:
8
Yesterday:
25