Monthly Archives: February 2014

Selenium Webdriver – Get SessionID from a Web Application

Getting SessionID/Cookies from a Web Application using Selenium

package com.test;

import java.util.concurrent.TimeUnit;
 import org.openqa.selenium.*;
 import org.openqa.selenium.firefox.FirefoxDriver;

public class GetSession {
 public static void main(String args[]) throws InterruptedException {
 WebDriver driver = new FirefoxDriver();
 try {
 String domainString = "http://yourURL";
 String baseUrl = domainString;
 driver.manage().timeouts().implicitlyWait(45, TimeUnit.SECONDS);
 driver.get(baseUrl + "/Login.aspx/");
 String ASPNET_SessionId = driver.manage().getCookieNamed("ASP.NET_SessionId").toString();
 finally {

Soap UI – Make JDBC Requests

To do the JDBC request from Soap UI, first we need to install the JDBC driver for the database we are using.

I am using SQL Server and so I have downloaded the JDBC driver for SQL server from here.

Extract the *.tar.gz file and copy the sqljdbc4.jar file.
Place this jar file under the “bin\ext\” directory where the SoapUI is installed in your machine.

C:\Program Files (x86)\SmartBear\SoapUI-4.6.4\bin\ext\

Now restart the Soap UI.[CLose and then Open]

Lets test this by creating a JDBC test Request.

1. Right Click on a test case and “Add Step” and clic “JDBC Request”
2. Give the driver name as
3. Specify the connection string as


Click on the Test Connection Button.

You should get a prompt like “Connection Tested Successfully”.

Now you are all set to goto make JDBC requests.

Give a sample SQL query under “SQL Query” text area like SELECT * FROM tablename
Run the Request.

You can able to see the results in the xml format.