Using Selenium TestNG/JUnit and XPath Checker to Automate GlassFish v3 AdminGUI Server

It's been almost 2 years since I first use Selenium/TestNG to automate test cases for SocialSite Project. At that time, I'm not aware of using XPath checker or DOM inspector to identify a web element locator ID.

The Selenium APIs and TestNG harness are much more improving and robust now. Writers should be able to search for any answers from the web since more testers/developers are writing Selenium. My long time headache problem which to open a single browser for running with multiple classes is resolved in TestNG interface ITestContext - put it before and after you start/stop your test class

public void startBrowser(ITestContext context){
        browser = new DefaultSelenium();
        context.setAttribute("browser",browser);
        browser.start(); }

public void stopBrowser(ITestContext context) {
       browser = (DefaultSelenium) context.getAttribute("browser",browser);
       browser.stop(); }

I'm writing test for both JUnit and testNG frameworks.  JUnit harness has been widely using in developers community so if one doesn't often share the workspace with developers, I suggest using TestNG frameworks

TestNG has more annotations which provides more flexibility, less test depedency, advanced parametric and re-runable features. In addition, TestNG result is automatically reported in xml/html format.

Click here for my GlassFish V3 Acceptance Test Model

My preferences to the xpath links http://seleniumhq.org/docs/04_selenese_commands.html
http://www.mulberrytech.com/quickref/ http://blogs.sun.com/rajeshthekkadath/entry/xpath_identifying_xpath_of_a

Comments:

Very informative article. I’ve found your blog via Yahoo and I’m really glad about the information you provide in your posts. Thank You for sharing this very informative article. http://www.pctechoutlet.com

Posted by Cheap Computers on February 12, 2010 at 02:55 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

davisn

Search

Categories
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