GUI testing automation

I got a gold idea on gui tesing taught by Uncle Bob, who is the author of Fitnesse in the mailing list. I am trying to implement "GUI testing on Fitnesse". You can get check my recent article, GUI testing automation.

Here is his wisdom;

Just make sure that you don't test any business rules that way.

Testing business rules through the GUI is a *terrible* form of

coupling. If you write thousands of tests through the GUI, and then

change your GUI, thousands of tests break.

 

Rather, test only GUI things through the GUI, and couple the GUI to a

dummy system instead of the real system, when you run those tests.

 

Test business rules through an API that doesn't involve the GUI.


It is very interesting the sentence, "test only GUI things through the GUI"
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by choipd

2008/12/04 21:01 2008/12/04 21:01
Response
7 Trackbacks , 3 Comments
RSS :
http://choipd.net/tc/rss/response/34

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

Steve Freeman's "Agile software people and team".

Steve Freeman is famus on agile movement. Today I met him in Xper group off meeting. He gave us his presentation about the Agile software, people, and team. It is quite new to me but very interesting topic.
이올린에 북마크하기(0) 이올린에 추천하기(0)

Posted by choipd

2008/10/27 01:10 2008/10/27 01:10
Response
No Trackback , No Comment
RSS :
http://choipd.net/tc/rss/response/31

« Previous : 1 : 2 : 3 : 4 : 5 : ... 9 : 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/03   »
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 31      

Site Stats

Total hits:
48616
Today:
64
Yesterday:
39