Automation Testing, Testing

Useful Functions for Automation Framework using Selenium Web Driver

While doing automation using selenium, there are certain repetetive tasks that we need to perform in order to handle page elements. So, the aim of this blog is to highlight some common operations that we need to handle every now and then. Some operations are: 1. Open URL in different browsers (Chrome, Firefox, IE) 2. Do mouse-hovers ...

by Sumit Gambhir
Tag: Java
28-May-2015

Grails

Receive Email using SubEthaSMTP (The local SMTP server).

In my Grails app, I came across a requirement of setting up an SMTP server for receiving mails and extracting their content. After exploring a lot I found SubEthaSMTP to be the most suitable. SubEthaSMTP lets your application receive an SMTP mail very easily. To setup an SMTP server in your application, You need to follow the steps as...

by Akash Sethi
Tag: Java
14-May-2014

Technology

Apache HTTP Conditional Policy Requests for checking whether resource is modified or not and reduce unnecessary processing

Hi, Before writing this blog, I would first like to make you familiar with one quote "Be liberal in what you accept, and conservative in what you send". Yes that's what HTTP robustness protocol states. Scenario : We have a use case where our server need to read XML files that are large containing 400 outer element with extremely...

by Tarun Pareek
Tag: Java
18-Apr-2014

Grails

Getting property class from property name

Recently in one of my project i had a requirement of identifying the class of a property of an object with object class and property name and then determining whether it's an Enum class or not. I found an easy solution for this using Reflection API. Using Java Reflection you can inspect the fields (member variables) of classes. This is...

by Sachin Verma
Tag: Java
26-Sep-2012

Grails

How to implement AOP Profiling in Grails application

In one of my recent project, i want to profile method execution time. I have used Spring AOP to profile method execution time. It's very easy to implement AOP profiling in grails 1. Suppose we have below mentioned service class, we want to log execution time of method saveDataStudent,saveDataUpdated methods in service class. We need...

by Mohit Garg
Tag: Java
25-Sep-2012

Technology

Normalization Forms for Accented Characters in Java

Text Normalization is the process of "standardizing" text to a certain form, so as to enable, searching, indexing and other types of analytical processing on it. Often working with large quantities of text we encounter character with accents like é , â etc. Unicode provides multiple ways to create such characters . For example we can...

by Sachin
Tag: Java
29-Jun-2012

Grails

How to configure SSL on Tomcat server and run Grails/Java application on HTTPS

To run your Grails application on SSL, firstly you need to configure the Tomcat server. Here in this example, I will show how to configure Tomcat instance and run Grails/Java application. For SSL/HTTPS: We need .keystore file. You can generate it by using command“keytool -genkey”. Run this command on linux terminal or window...

by Mohit Garg
Tag: Java
29-Jun-2012

Technology

Set-up SSL Communication between two Linux servers Using Keytool Command

In one of my project, My front end application runs on one server and back end application runs on another. Both application have to communicate with each other through SSL(Secure Sockets Layer). SSL is a way to secure internet communication from your browser to a secure website. The websites using SSL will have https:// to their name. ...

by Gautam Malhotra
Tag: Java
31-May-2012

Grails

Dealing with immutable collections in Java

Perhaps, you know it before or just skipped it after going through Java API. But I really found it very helpful at this point.   Recently, I had a requirement in an open-source project, where users can iterate through the objects saved in collections (esp. List). But the problem was, we really didn’t want users to directly or...

by Salil
Tag: Java
11-Apr-2012

Grails

Grails: Dynamically create instance of a POGO class

Hi guys, Recently on a project, I was creating a number of command objects to accept incoming parameters from a POST call from an iPhone with which I needed to sync data. I created a parent class for all command object classes to accept the common properties and created individual command object classes to accept any additional...

by Roni C Thomas
Tag: Java
15-Jun-2011

Grails

Groovy: Sort list of objects on the basis of more than one field

Usually, when we deal with databases, we don't face such kind of situation because we query database to get result-set in required order. But let's say you have a List of objects that you want to sort on the basis of two fields. Let's discuss it with an example. I have a list of Tasks (with date and priority fields). I want to sort...

by Salil
Tag: Java
25-Jan-2011

Grails

Encode Content to MD5 Using GROOVY or GRAILS – with Webhook example

Recently I was working on webhooks (which are getting quite popular for sending notifications to other applications using HTTP POST methods). MD5 encoded content is heavily used in webhooks for security concern. My purpose of writing this blog is neither to explain MD5 nor webhooks. But just to show you - 1. a quicker way in...

by Salil
Tag: Java
12-Nov-2010