Monday Feb 11, 2008

Glassfish GUI Automation with Selenium (Java)

Want to try Glassfish Admin GUI with Selenium and experience the differences between SilkTest and Selenium tools


1. Run Selenium from the build 
If you build admin-gui module you can find the README.SeleniumRC file under the ../glassfish/admin-gui/tests directory. Just follow the instruction from the file, you should be able to setup and run Selenium JBI tests with Glassfish Admin GUI. If you encounter a failure from your browser, open selenium test case files under java directory and replace statement
selenium.waitForCondition("Selenium.browserbot.isNewPageLoaded()", TIMEOUT_PERIOD) by
selenium.waitForPageToLoad( TIMEOUT_PERIOD)


2. Run Selenium with Glassfish V2 binary bit
    1. You must setup the environment by installing Selenium IDE on your Firefox browser
    2. Having ant 1.6.5 and jdk1.5.0_11 or latest version installed on your system
    3. Create a AdminGUITest directory on your system and copy the following 4 files to the ../AdminGUITest/lib directory
selenium-server.jar , selenium-java-client.jar, selenium-java-client-driver-tests.jar and testng-5.5-jdk15.jar  and junit.jar
     4. Copy the simple test harness (AdminGUITest.jar file) to your AdminGUI directory and unjar the file
     5. Update build.properties file  with your setup environment
     6. Start the selenium remote server (assume you're using a window system)
cd  %AdminGUITest.home%
             java -jar selenium-server.jar
     7. Start glassfish domain1
     8. Run the first AdminGUI test case
             cd  %AdminGUITest.home%
      ant run-test
3. Differences between SilkTest and Selenium




































































































Features Selenium SilkTest
HTLM Web Object Support Yes Yes
Easy Creation Object Scripts (Record and Playback) Yes
Yes
Scripting in variety languages (Java, Perl, C#, PHP, ..) Yes No (Only 4test language)
Ability to run test with build scripts (maven, ant,..) Yes No
Support Different Browsers Yes Yes
Reusability of Scripts Yes Yes
Commercial Support Yes Yes
Test Debugging Yes Yes
Result Reporting Fair Yes
Exception Handling Fair Yes
Java Objects (beyond the browsers) No Yes
Https protocol support Yes (some configuration required)
Yes
Capable of record exactly same as end-user desire Fair Yes
Organize tests according to the manual Test Plan No Yes
Data Driven Test Framework No Yes
Mechanism to create test independently (one test should not depend on other) No
Yes
Support Multiple OS Yes Yes
Comprehesive Test (run for > 8 hrs)
Weak Yes

Thursday Dec 20, 2007

Glassfish GUI Automation Tools (SilkTest)

Why SilkTest / Selenium 


If you want to automate your applications with Glassfish Admin GUI. There are few software tools that you can use such as: SilkTest, Selenium, Httpunit, WinRunner,  Among those tools I found SilkTest and Selenium work best to automate Glassfish Admin GUI test cases. This blog shows you the steps to setup and configure SilkTest for Glassfish Admin GUI. For selenium, please click this link

SilkTest 2006 R2 and SilkTest 7.6 are the two versions we are currently using for Glassfish V2. Since SilkTest is mainly installed and executed on a Window machine, you should write your test to run with IE browser. It doesn't matter if Glassfish installed on a Solaris, a Linux or a MacOS machine; you will not find any problem to run SilkTest on a client window machine.

The browser we've been testing is IE 6/7, but Silktest can also run with FireFox or Mozilla browsers. If you have Glassfish installed on a machine which is different than SilkTest automation suites
installed, please do the extra step (1 or 2) below:


1. For Solaris
  -Login the Solaris machine as root
  -Edit /etc/hosts.equiv file > add + + line in the file.
  -Go to root directory > edit file .rhosts > add a line + + in the file.
On the window where SilkTest installed, put rsh.exe name in the machine PATH. rsh.exe file should be located under c:\\windows\\system32 directory


2. For Linux:
  -Login the Linux machine as root.
  -Edit /etc/pam.d/rsh file >  change all “required” to “sufficient”
  -Edit /etc/securetty file > add “rsh” at the bottom
  -To check if rsh working, on window, type: rsh <LinixHostname> -l root ls. You should see all files under Linux root machine listed.



Config SilkTest:
    -From window, click Start menu->Programs->SilkTest->Extension Enabler.
    -Select to enable extension by selecting
“IE DOM” from Primary Extension of the correct IE version. Remeber to disable all extensions for all other browsers and java application. > click “OK” button when done. (Please see the
picture below)




    -Again click Start menu->Programs->SilkTest->SilkTest to bring up SilkTest > click Options menu > Extensions > enable only IE version to test and disable all other extensions > click “OK” button when done.
    -Click Options menu > Agent > click Timing tab > give 60 in the “Window timeout” field >
Uncheck all check boxes in verification click “OK” button when done.  (Please, see the figure below)



    -Click Options menu > Runtime and remove all content in Use Path field > make sure only “extend\\explorer.inc” appears in the “Use Files” field and the correct IE browser version in the “Default browser” field.  (click here for the runtime option picture)




That is much you need to do.

Wednesday Dec 19, 2007

Webservice Monitoring Realtime Statistic for Glassfish V2

I encountered question how to view the Webservice Monitoring Realtime
Statistic for Glassfish V2 project. This blog lists the steps to configure Webservice Monitoring Realtime Statistic.

-First, please follow the instruction from the technical article Managing and Monitoring Web Services in Project GlassFish to configure your Web service monitoring managing level.
-From admin GUI console, click Common Tasks menu > View Monitoring Data > Call Flow  >
select to enable Call Flow Monitoring > click to save the changes


For EE version, in addition to the steps above, please start the Derby database.

Thursday Jun 01, 2006

Writing a Simple XSLT Transformation Rule File

XSLT transformation rule can be applied to a Web Service endpoint. The transformation rule will enable fine-grained control of web service requests and responses. To config, please use the following document http://docs.sun.com/app/docs/doc/819-3658/6n5s5nko6?a=view

For a simple web service application, down load the template files below. Replace the bold text in the template files with your appropriate web service method name and its result data. For example, if your web service application has a method named myMethod and the method returns a string "Hello World" then just replace sayHello by myMethod and the return string "This is ...TEST" by "Hello World"

For JAX-WS application, replace http://service/ with your targetNamespace value. For JAX-RPC, replace http://hello.org/wsdl/HelloWorld by wsdl-port xmlns:wsdl-port_ns_ value from webservices.xml file

Template Files


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