Java Frameworks

Selenium | How to count the number of products on a web page

Author - Namisha

In this post I will give an example of a Selenium script to count the number of products displayed on a web page. This is the screenshot of webpage:

As you can see products are displayed row wise with 4 products in 1 row. On scrolling down there are many Read more…

Curl | How to test a Restful web service using curl

Author - Rita

Let’s consider, we have a demo Restful service (created in Java Spring here but you can create in any language) to login user which accepts username and password as input and returns Success/Failure in response.

Request Object : Demo Login Request class :

Response Object :

Here is how to call Read more…

Javascript | How to post Acord PDF Forms data to a Web URL

Author - Webner

Description : You have Fillable PDF on which you have button “Save Entered Data”. On button you want post the form data to php file.

Solution :

Follow these steps :

1. Open Form with Adobe Acrobat Pro. Goto–>Tools.

2. From Tools, Go to Tools–>Rich Media.

3. Click on Select Object Read more…

jQuery EasyUI datagrid | How to solve “no text wrapping” problem

Author - Webner

See the screenshot below :

Line no 7 and 8 indicate problems due to no word wrapping

Solution :

Use Javascript property ‘nowrap=false’ in your datagrid creation.

Code :

<table id=”dg” title=”Activity Info” class=”easyui-datagrid” style=”width:100%;height:81%”
toolbar=”#toolbar #searchtoobar” nowrap=”false”
rownumbers=”true” fitColumns Read more…

Javascript | How to write code in Adobe Acrobat

Author - Shalini

Steps to write script in Adobe Acrobat Pro

1. In Adobe Acrobat Pro, open Tools panel on the right, and search for Action wizard.

2. Double click on Action Wizard to open it. Click on New Action Wizard. It will open a new window. Click on More tools label and Read more…

Database Connectivity with Selenium Webdriver

Author - Webner

How to connect to Mysql in Selenium script?

Step 1: Import Mysql connector (JDBC driver):

Download connector from:


Download this jar file and import in Eclipse : MySQL-connector-java-5.1.18-bin.jar

Follow these steps in Eclipse:

Add the downloaded Jar to your Read more…

JavaScript/HTML | Get Id of inner child element

Author - Kritika Sood

Suppose from html code below we want to get id of each <a> element inside home_menu.

<ul id=”home_menu” class=”appendmenu” style=”float: left”>
<span class=”arrow sep”>►</span>
<a id=”breadcrumb_mainc3″ style=”cursor:pointer;color:#087bb1;”>Programming Read more…

Javascript | How to change form action dynamically

Author - Kritika Sood

Suppose on click of an element we want to change the form action URL. In this example, we are assuming a textbox in which user will type a value and then click search magnifying glass icon. On click of search icon we want to check if textbox is empty or Read more…

Netsuite | Authentication/Login to Netsuite sandbox account through java code using Netsuite WSDL

Author - Richa

Authentication/Login to Netsuite sandbox account through java code using Netsuite WSDL

In order to login to your sandbox Netsuite sandbox account via code, you need to have below files handy:

1. Netsuite sandbox WSDL:

The latest version of wsdl can be downloaded from Netsuite site’s developers Read more…

Salesforce | How to call apex method using Javascript

Author - Kiran Preet

We can call apex method from javascript using JavaScript remoting.

Javascript remoting has three main parts :

1. Invoke remote method written in javascript method on Visualforce page.

2. Remote apex method contains an annotation @RemoteAction.

3. The response handler callback function written in javascript method on visualforce page.

Example of Read more…

jQuery line control HTML editor | Post data to server

Author - Parminder Kaur

In jQuery line-control editor, values written inside writing space (div) do not get posted to the server by default. This is because although we create textarea while coding, at run time a DIV is created in which user writes. Editor.editor is the Id of div at runtime. On Read more…

LESS Introduction | Dynamic CSS styling

Author - Webner

LESS is an open source CSS pre-processor designed by Alexis Sellier in 2009. It is not exactly CSS but acts like one with the help of Javascript libraries that interpret the stylesheet and make it readable for browsers. The very first benefit of using LESS is that LESS is Read more…

Salesforce | Different ways to use datepicker on visualforce page

Author - Shalini

1. Apex:inputfield:

We can simply use apex:inputfield and bind the field with date type field and it will automatically use the Salesforce Calander:
<apex:page standardcontroller=Contact>
<apex:inputfield value=”{!Contact.Birthdate}”>
</apex:page&gt Read more…

How to create WSDL web service client using Maven

Author - Rita

Maven provides apache cxf plugin to generate web service client.
We have used below code in our pom.xml file to generate java artifact classes (web service client).

There are two ways to generate client code:

Using complete WSDL URL

Using WSDL artifact

1. Using complete WSDL URL Read more…

Netsuite | Invalid email address or account number error on NetSuite, but passed correct credentials

Author - Neha Mishra

ERROR: Invalid email address or account number error on NetSuite, but passed correct credentials.

Need to authenticate NetSuite sandbox account through java application and fetch all the contacts. Below is the link to the WSDL file used to log in:

Click here

But on attempting the login with Read more…

Java | Delete empty string from list or array

Author - Webner

public class deleteEmptyStringQuick
public static void main(String[] args)
String[] emptyStringArray={“test”,”test1″,””,”test3″,””,”test4″};
ArrayList arrayListOfEmptyString=(ArrayList) Arrays.asList(emptyStringArray);

//normally we will do this
ArrayList filteredList = new ArrayList();
for(String string: arrayListOfEmptyString)

//You can achieve this with single line as well:
filteredList Read more…

Salesforce | Change value of an object’s field on button click and reload page

Author - Webner

We can change the value of an object’s field on button click by using javascript like this (and this will also reload the page):
var rec = new sforce.SObject(“Contact”);
rec.Id = “{!Contact.Id}”;
rec.IsActive= ‘true’;
var result = sforce.connection.update Read more…

Java | Configure Tomcat as a service on linux

Author - Navneet Kashyap

Configure Tomcat service in Linux:

These instructions are related to installing and running Tomcat 7 as a service, which means that it will be launched at system boot and will be closed properly on system shutdown.

Running tomcat as a service in Linux:

For security reasons, you should not run Read more…

ACORD Forms autofill

Author - Webner

We get this request from a lot of clients in US insurance industry who want to generate ACORD forms automatically, means they want data of corresponding insurance Policy and other objects filled automatically in the editable ACORD PDF. Most of the clients have their data in a CRM system like Read more…

java.sql.SQLException: Data truncated for column date at row 1

Author - Webner

You may face this exception while trying to insert data in a mysql table using hibernate:

java.sql.SQLException: Data truncated for column date at row 1

While there can be different reasons of this problem, in our case it was occurring because by mistake we were trying to insert Read more…