You are on page 1of 3

OFBiz SeleniumXml Introduction

1/9/2009
This is a short document to help you get started using SeleniumXml to test your OFBiz application !ere is a copy o" the
presentation that #as gi$en at the %pache&on200' OFBiz &on"erence that descri(es more a(out the pro)ect*
http://us.apachecon.com/presentation/materials/118/ApacheCon2008_SeleniumXml.pdf
Installing SeleniumXml
1 +nzip the o"(iz,selenium-mlzip in the o"(iz/"rame#or. directory This #ill copy the source "iles/ li(raries/ dtd/
con"ig "iles/ and sample test scripts into the testtools "older
2 %pply the o"(iz,seleniumpatch "ile "rom your OFBI01!O23 directory 4eg o"(iz5
6 From the o"(iz/"rame#or./testtools directory run the "ollo#ing ant command to do#nload the needed selenium,
ser$er)ar "ile
1 ant install,selenium-ml
7 Build the source (y running 8ant9 in the testtools directory or your OFBI01!O23
:ou should no# ha$e e$erything you need to run a seleniumXml test
;unning the 3-ample Test
SeleniumXml re<uires the selenium ser$er to (e running The selenium ser$er uses a de"ault pro-y port o" 7777 The
de"ault port can (e changed #hen you start the ser$er Selenium tries to automatically change the pro-y settings in the
testing (ro#ser I" you are getting communication errors #ith the ser$er you may ha$e to manually change your pro-y
settings in your (ro#ser
1 Start o"(iz as normal
1 =ote* the patch changes o"(iz to not use !TT>S as the de"ault Instead e$erything )ust #or.s through port
'0'0 Selenium supports https (ut it is more complicated so "or this introduction I ha$e turned https o""
2 Start the selenium ser$er*
1 runSeleniumSer$er(at 4sorry I don?t ha$e a shell script created yet/ (ut the script is simple and can easily (y
adapted5
6 &hange the con"iguration "or your pre"erred (ro#ser in the testtools/con"ig/selenium-mlproperties "ile The
de"ault is "ire"o- 4eg (ro#ser@A"ire"o-5 (ut you can change it to any o" the selenium supported (ro#sers
1 Selenium supported (ro#sers* http*//seleniumh<org/a(out/plat"ormshtmlB(ro#sers
7 ;un the 3-ample test
2 runSeleniumXml(at testde"/selenium-ml/e-ample1testsuite-ml
6 The a(o$e test com(ines three di""erent tests into a single test suite Cata is passed "rom one test to another to
allo# you to share generated data
7 :ou #ill get an assertion 4or other e-ception5 i" the test "ails
D The test uses a D second delay "or demo purposes 4see e-ample1testsuite-ml and the EsetSpeed $alue@FD00F
/G command5 :ou can remo$e this at the start o" the test i" you don?t #ant the delay
!ere are some screen shots o" #hat you should (e seeing
&reating =e# Tests
The easiest #ay to create a ne# test is to use the Selenium IC3 plugin "or Fire"o- This allo#s you to records your o#n
Selenium tests :ou can then sa$e the test and con$ert it to a seleniumXml test easily
1 Install the latest plugin at http*//seleniumh<org/pro)ects/ide/
2 ;ecord your steps as you run through your o"(iz application
6 Then con$ert the sa$ed X2H "ile using the con$ertSeleniumIC3(at script
1 For e-ample*
2 con$ertSeleniumIC3(at testde"/selenium-ml/e-ample/recorded/%)a-3-amplehtml
testde"/selenium-ml/e-ample/recorded/%)a-3-ample-ml
6 2anually modi"y the commands to suit your needs

You might also like