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 applicationclass 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?
Posted by choipd


