Selenium – Browser based Tool for Integration Testing of Web Applications (JavaPolis Quicky)

2
Share this on .. Tweet about this on Twitter0Share on LinkedIn0Share on Facebook0Share on Google+0Email this to someoneShare on TumblrBuffer this page

Selenium, a test-tool for Web Applications, was the subject of one of the quicky presentations (15 minutes max) on JavaPolis this week. It is described as: Selenium is a test tool for web applications. Selenium tests run
directly in a browser, just as real users do. And they run in
Internet Explorer, Mozilla and Firefox on Windows, Linux, and Macintosh. I was not able to attend the presentation, but I got intrigued by the short description. I went to the website at http://www.openqa.org/selenium/index.html and browsed a little, trying the demos etc. My first impressions are very favorable: using a very simple scripting language, you instruct the test engine to navigate through a web-application, clicking buttons and links, settings values in form items all the while verifying the responses of the application. As attractive test-tools should do, it has good visual feedback, showing what tests passed and which ones failed. Note that it provides a very easy way of doing cross browser testing: ensuring that an application works on different browser (versions) on different operating systems. 

I have downloaded Selenium and will try it out on one my of own web-applications. To get started is as simple as copying an entire directory to a web accessible directory in the same web server as the application you want to test. In Apache, this would mean a subdirectory of “htdocs”. For my web application, running from within JDeveloper 10.1.2, that meant under public_html but outside of WEB-INF. Once the application is running in the browser, the Selenium Self test can be started by pointing the browser to an html document in the Selenium directory just copied.

The next step obviously is creating a test for my own application. It takes a little getting used to the syntax of the commands, but it took me less than 15 minutes to get started with testing the application. I have navigated to the login-page, entered values in the username and password fields, clicked a button to submit by login attempt, navigated to the first page in the application and verified its title. Not bad for a first encounter of a close kind. Definitely worth looking into, this tool!

My first test-script:

Test Entering the contacts application
open../StartContactsAppModule.do
verifyTitleDSG Contacts
typeusernameevda
typepassworddamen
clickevent_login
verifyTitlewelcome

 

Share this on .. Tweet about this on Twitter0Share on LinkedIn0Share on Facebook0Share on Google+0Email this to someoneShare on TumblrBuffer this page

About Author

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director for Fusion Middleware. Consultant, trainer and instructor on diverse areas including Oracle Database (SQL & PL/SQL), Service Oriented Architecture, BPM, ADF, JavaScript, Java in various shapes and forms and many other things. Author of the Oracle Press books: Oracle SOA Suite 11g Handbook and Oracle SOA Suite 12c Handbook. Frequent presenter on conferences such as JavaOne and Oracle OpenWorld. Presenter for Oracle University Celebrity specials.

2 Comments

  1. Hi Lucas,

    I’ve you ever tried to test ADF Faces dialogs with Selenium because ?
    If you tried and succeeded could you share the solution please ?

    Thanks,
    Seb.