Thursday Jun 18, 2009

How to setup a Test Automation Infrastructure using Selenium, JUnit, Hudson & ANT

Goal : Setting up a test infrastructure & automation solution for web application testing (functional testing)

Tools : JUnit, Hudson, Selenium RC, Ant, Xalan

Requirements:

  • Automation should start the tests immediately when a new build is available in the SVN repository (Hudson has scheduling capability)
  • Automation can be invoked using a browser On-Demand, whenever user needs to run tests on a build (User can trigger tests in Hudson using a browser URL)
  • Automation should be running on multiple OS machines & browsers (Hudson Master/Slave approach will solve this issue)
  • Once the automation is completed, it should send a report as an email to the team alias. Old reports also needs to be archived.
  • User should be able to run the automation as a seperate ANT task & from Netbeans IDE
  • Reports can be automatically published as a wiki page in a wiki system which the team uses for project management (Note: This solution will be covered in a seperate blog & NOT in this)

Steps:

1. Install Hudson in Master / Slave mode

2. Prepare ant scripts so that it will

  • Checkout the product from SVN repository and installs it on test machine
  • Do all the pre requisite for successfully running our tests [Start selenium server and the tests]
  • After the test execution is completed, archive the old reports and save the new report and email it to the team alias.
  • Do all the necessary cleanup at the end

3. Now call these ant scripts within Hudson and schedule it to run as per your requirement

Monday Mar 31, 2008

Automation using ANT - Reading from a file

Reading values from a external file [Read More]

Sunday Mar 30, 2008

Automation using ANT - Replacing tokens in a file

Replacing a tokens of a file with the values provided in another file
[Read More]

Monday May 28, 2007

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher

When i run /usr/sfw/bin/ant command i get the below exception
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/tools/ant/launch/Launcher

Workaround:

1. Set ANT_HOME=/usr/sfw
2. Set JAVA_HOME=/usr/jdk/entsys-j2se/
3.  /usr/sfw/bin/ant command should run successfully now

Note: On a PortalServer installed on Linux system, ant can be found in /opt/sun/bin/ant
 

About

I'm a Quality Engineer at Sun Microsystems. Here in this blog, you may find information about Software Testing, Portal Server, Virtualization, Web2.0 and Misc Technical topics. The views expressed here are personal and does not reflect that of my employer

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
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
   
       
Today