Tuesday, May 9, 2017

TestUtil

package com.kanvz.util;

import java.io.File;
import java.io.IOException;
import java.util.Hashtable;

import org.apache.commons.io.FileUtils;
import org.openqa.selenium.OutputType;
import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;

import com.kanvz.testcases.TestBase;

import net.sf.cglib.core.Local;

public class TestUtil {
// true - Y
// false - N


public static boolean isTestSuiteExecutable(String testSuite, Xls_Reader xls){


for(int rNum=2;rNum<=xls.getRowCount("Test Suite");rNum++){

if(testSuite.equals(xls.getCellData("Test Suite", "TestSuite", rNum))){
// check runmode
if(xls.getCellData("Test Suite", "RunMode", rNum).equals("Y"))
return true;
else
return false;
}

}

return false;

}


public static boolean isTestCaseExecutable(String testCase, Xls_Reader xls){


for(int rNum=2;rNum<=xls.getRowCount("Test Functions");rNum++){

if(testCase.equals(xls.getCellData("Test Functions", "TestCases", rNum))){
// check runmode
if(xls.getCellData("Test Functions", "RunMode", rNum).equals("Y"))
return true;
else
return false;
}

}

return false;

}


public static void takeScreenShot(String fileName) {
File srcFile = ((TakesScreenshot)(TestBase.driver)).getScreenshotAs(OutputType.FILE);
   try {
    FileUtils.copyFile(srcFile, new File(System.getProperty("user.dir")+"\\screenshots\\"+fileName+".jpg"));
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
 
   
}

public static String captureScreenshot(WebDriver driver, String screenShotName)
{

try
{
TakesScreenshot ts = (TakesScreenshot)driver;
File source = ts.getScreenshotAs(OutputType.FILE);
String dest = System.getProperty("user.dir")+"\\screenshots\\"+screenShotName+".jpg";

File destination = new File(dest);
FileUtils.copyFile(source, destination);
System.out.println("Screen Shot Taken");
return dest;
}
catch(Exception e)
{
System.out.println("Exception While Taking Screen Shot " + e.getMessage());
return e.getMessage();
}




}

//Getting the current Methid Name


public static void getCurrentMethodName()
{

}


public static Object[][] getData(String sheetName  ,String testCase,Xls_Reader xls){
System.out.println("*******sheetName******"+ sheetName);
// find the test in xls
// find number of cols in test
// number of rows in test
// put the data in hashtable and put hashtable in object array
// return object array

int testCaseStartRowNum=0;
for(int rNum=1;rNum<=xls.getRowCount(sheetName);rNum++){
if(testCase.equals(xls.getCellData(sheetName, 0, rNum))){
testCaseStartRowNum = rNum;
break;
}
}
//System.out.println("Test Starts from row -> "+ testCaseStartRowNum);


// total cols
int colStartRowNum=testCaseStartRowNum+1;
//System.out.println("ColumSTart Row Number is " +colStartRowNum);
int cols=0;
while(!xls.getCellData(sheetName, cols, colStartRowNum).equals("")){
cols++;
}
//System.out.println("Total cols in test -> "+ cols);


// rows
int rowStartRowNum=testCaseStartRowNum+2;
//System.out.println("Row Start Row Number is " +rowStartRowNum);
int rows=0;
while(!xls.getCellData(sheetName, 0, (rowStartRowNum+rows)).equals("")){
rows++;
}
// System.out.println("Total rows in test -> "+ rows);
Object[][] data = new Object[rows][1];
Hashtable<String,String> table=null;

// print the Login_SignUp_TestData
for(int rNum=rowStartRowNum;rNum<(rows+rowStartRowNum);rNum++){
table=new Hashtable<String,String>();
for(int cNum=0;cNum<cols;cNum++){
table.put(xls.getCellData(sheetName, cNum, colStartRowNum),xls.getCellData(sheetName, cNum, rNum));
//System.out.print(xls.getCellData("Login_SignUp_TestData", cNum, rNum)+" - ");
}
data[rNum-rowStartRowNum][0]=table;
//System.out.println();
}

return data;// dummy




}

}

Monday, February 2, 2015

xls_Reader

package com.qtpselenium.util;



import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFHyperlink;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;

import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.xssf.usermodel.*;


import java.io.*;
import java.util.Calendar;


public class Xls_Reader {
public static String filename = System.getProperty("user.dir")+"\\src\\config\\testcases\\TestData.xlsx";
public  String path;
public  FileInputStream fis = null;
public  FileOutputStream fileOut =null;
private XSSFWorkbook workbook = null;
private XSSFSheet sheet = null;
private XSSFRow row   =null;
private XSSFCell cell = null;

public Xls_Reader(String path) {

this.path=path;
try {
fis = new FileInputStream(path);
workbook = new XSSFWorkbook(fis);
sheet = workbook.getSheetAt(0);
fis.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
// returns the row count in a sheet
public int getRowCount(String sheetName){
int index = workbook.getSheetIndex(sheetName);
if(index==-1)
return 0;
else{
sheet = workbook.getSheetAt(index);
int number=sheet.getLastRowNum()+1;
return number;
}

}

// returns the data from a cell
public String getCellData(String sheetName,String colName,int rowNum){
try{
if(rowNum <=0)
return "";

int index = workbook.getSheetIndex(sheetName);
int col_Num=-1;
if(index==-1)
return "";

sheet = workbook.getSheetAt(index);
row=sheet.getRow(0);
for(int i=0;i<row.getLastCellNum();i++){
//System.out.println(row.getCell(i).getStringCellValue().trim());
if(row.getCell(i).getStringCellValue().trim().equals(colName.trim()))
col_Num=i;
}
if(col_Num==-1)
return "";

sheet = workbook.getSheetAt(index);
row = sheet.getRow(rowNum-1);
if(row==null)
return "";
cell = row.getCell(col_Num);

if(cell==null)
return "";
//System.out.println(cell.getCellType());
if(cell.getCellType()==Cell.CELL_TYPE_STRING)
 return cell.getStringCellValue();
else if(cell.getCellType()==Cell.CELL_TYPE_NUMERIC || cell.getCellType()==Cell.CELL_TYPE_FORMULA ){

 String cellText  = String.valueOf(cell.getNumericCellValue());
 if (HSSFDateUtil.isCellDateFormatted(cell)) {
          // format in form of M/D/YY
 double d = cell.getNumericCellValue();

 Calendar cal =Calendar.getInstance();
 cal.setTime(HSSFDateUtil.getJavaDate(d));
           cellText =
            (String.valueOf(cal.get(Calendar.YEAR))).substring(2);
          cellText = cal.get(Calendar.DAY_OF_MONTH) + "/" +
                     cal.get(Calendar.MONTH)+1 + "/" +
                     cellText;
         
          //System.out.println(cellText);

        }



 return cellText;
 }else if(cell.getCellType()==Cell.CELL_TYPE_BLANK)
     return "";
 else
 return String.valueOf(cell.getBooleanCellValue());

}
catch(Exception e){

e.printStackTrace();
return "row "+rowNum+" or column "+colName +" does not exist in xls";
}
}

// returns the data from a cell
public String getCellData(String sheetName,int colNum,int rowNum){
try{
if(rowNum <=0)
return "";

int index = workbook.getSheetIndex(sheetName);

if(index==-1)
return "";


sheet = workbook.getSheetAt(index);
row = sheet.getRow(rowNum-1);
if(row==null)
return "";
cell = row.getCell(colNum);
if(cell==null)
return "";

 if(cell.getCellType()==Cell.CELL_TYPE_STRING)
 return cell.getStringCellValue();
 else if(cell.getCellType()==Cell.CELL_TYPE_NUMERIC || cell.getCellType()==Cell.CELL_TYPE_FORMULA ){

 String cellText  = String.valueOf(cell.getNumericCellValue());
 if (HSSFDateUtil.isCellDateFormatted(cell)) {
          // format in form of M/D/YY
 double d = cell.getNumericCellValue();

 Calendar cal =Calendar.getInstance();
 cal.setTime(HSSFDateUtil.getJavaDate(d));
           cellText =
            (String.valueOf(cal.get(Calendar.YEAR))).substring(2);
          cellText = cal.get(Calendar.MONTH)+1 + "/" +
                     cal.get(Calendar.DAY_OF_MONTH) + "/" +
                     cellText;
         
         // System.out.println(cellText);

        }



 return cellText;
 }else if(cell.getCellType()==Cell.CELL_TYPE_BLANK)
     return "";
 else
 return String.valueOf(cell.getBooleanCellValue());
}
catch(Exception e){

e.printStackTrace();
return "row "+rowNum+" or column "+colNum +" does not exist  in xls";
}
}

// returns true if data is set successfully else false
public boolean setCellData(String sheetName,String colName,int rowNum, String data){
try{
fis = new FileInputStream(path);
workbook = new XSSFWorkbook(fis);

if(rowNum<=0)
return false;

int index = workbook.getSheetIndex(sheetName);
int colNum=-1;
if(index==-1)
return false;


sheet = workbook.getSheetAt(index);


row=sheet.getRow(0);
for(int i=0;i<row.getLastCellNum();i++){
//System.out.println(row.getCell(i).getStringCellValue().trim());
if(row.getCell(i).getStringCellValue().trim().equals(colName))
colNum=i;
}
if(colNum==-1)
return false;

sheet.autoSizeColumn(colNum);
row = sheet.getRow(rowNum-1);
if (row == null)
row = sheet.createRow(rowNum-1);

cell = row.getCell(colNum);
if (cell == null)
       cell = row.createCell(colNum);

   // cell style
   //CellStyle cs = workbook.createCellStyle();
   //cs.setWrapText(true);
   //cell.setCellStyle(cs);
   cell.setCellValue(data);

   fileOut = new FileOutputStream(path);

workbook.write(fileOut);

   fileOut.close();

}
catch(Exception e){
e.printStackTrace();
return false;
}
return true;
}


// returns true if data is set successfully else false
public boolean setCellData(String sheetName,String colName,int rowNum, String data,String url){
//System.out.println("setCellData setCellData******************");
try{
fis = new FileInputStream(path);
workbook = new XSSFWorkbook(fis);

if(rowNum<=0)
return false;

int index = workbook.getSheetIndex(sheetName);
int colNum=-1;
if(index==-1)
return false;


sheet = workbook.getSheetAt(index);
//System.out.println("A");
row=sheet.getRow(0);
for(int i=0;i<row.getLastCellNum();i++){
//System.out.println(row.getCell(i).getStringCellValue().trim());
if(row.getCell(i).getStringCellValue().trim().equalsIgnoreCase(colName))
colNum=i;
}

if(colNum==-1)
return false;
sheet.autoSizeColumn(colNum); //ashish
row = sheet.getRow(rowNum-1);
if (row == null)
row = sheet.createRow(rowNum-1);

cell = row.getCell(colNum);
if (cell == null)
       cell = row.createCell(colNum);

   cell.setCellValue(data);
   XSSFCreationHelper createHelper = workbook.getCreationHelper();

   //cell style for hyperlinks
   //by default hypelrinks are blue and underlined
   CellStyle hlink_style = workbook.createCellStyle();
   XSSFFont hlink_font = workbook.createFont();
   hlink_font.setUnderline(XSSFFont.U_SINGLE);
   hlink_font.setColor(IndexedColors.BLUE.getIndex());
   hlink_style.setFont(hlink_font);
   //hlink_style.setWrapText(true);

   XSSFHyperlink link = createHelper.createHyperlink(XSSFHyperlink.LINK_FILE);
   link.setAddress(url);
   cell.setHyperlink(link);
   cell.setCellStyle(hlink_style);
   
   fileOut = new FileOutputStream(path);
workbook.write(fileOut);

   fileOut.close();

}
catch(Exception e){
e.printStackTrace();
return false;
}
return true;
}



// returns true if sheet is created successfully else false
public boolean addSheet(String  sheetname){

FileOutputStream fileOut;
try {
workbook.createSheet(sheetname);
fileOut = new FileOutputStream(path);
workbook.write(fileOut);
    fileOut.close();  
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}

// returns true if sheet is removed successfully else false if sheet does not exist
public boolean removeSheet(String sheetName){
int index = workbook.getSheetIndex(sheetName);
if(index==-1)
return false;

FileOutputStream fileOut;
try {
workbook.removeSheetAt(index);
fileOut = new FileOutputStream(path);
workbook.write(fileOut);
   fileOut.close();  
} catch (Exception e) {
e.printStackTrace();
return false;
}
return true;
}
// returns true if column is created successfully
public boolean addColumn(String sheetName,String colName){
//System.out.println("**************addColumn*********************");

try{
fis = new FileInputStream(path);
workbook = new XSSFWorkbook(fis);
int index = workbook.getSheetIndex(sheetName);
if(index==-1)
return false;

XSSFCellStyle style = workbook.createCellStyle();
style.setFillForegroundColor(HSSFColor.GREY_40_PERCENT.index);
style.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);

sheet=workbook.getSheetAt(index);

row = sheet.getRow(0);
if (row == null)
row = sheet.createRow(0);

//cell = row.getCell();
//if (cell == null)
//System.out.println(row.getLastCellNum());
if(row.getLastCellNum() == -1)
cell = row.createCell(0);
else
cell = row.createCell(row.getLastCellNum());
     
       cell.setCellValue(colName);
       cell.setCellStyle(style);
     
       fileOut = new FileOutputStream(path);
workbook.write(fileOut);
   fileOut.close();  

}catch(Exception e){
e.printStackTrace();
return false;
}

return true;


}
// removes a column and all the contents
public boolean removeColumn(String sheetName, int colNum) {
try{
if(!isSheetExist(sheetName))
return false;
fis = new FileInputStream(path);
workbook = new XSSFWorkbook(fis);
sheet=workbook.getSheet(sheetName);
XSSFCellStyle style = workbook.createCellStyle();
style.setFillForegroundColor(HSSFColor.GREY_40_PERCENT.index);
XSSFCreationHelper createHelper = workbook.getCreationHelper();
style.setFillPattern(HSSFCellStyle.NO_FILL);

 

for(int i =0;i<getRowCount(sheetName);i++){
row=sheet.getRow(i);
if(row!=null){
cell=row.getCell(colNum);
if(cell!=null){
cell.setCellStyle(style);
row.removeCell(cell);
}
}
}
fileOut = new FileOutputStream(path);
workbook.write(fileOut);
   fileOut.close();
}
catch(Exception e){
e.printStackTrace();
return false;
}
return true;

}
  // find whether sheets exists
public boolean isSheetExist(String sheetName){
int index = workbook.getSheetIndex(sheetName);
if(index==-1){
index=workbook.getSheetIndex(sheetName.toUpperCase());
if(index==-1)
return false;
else
return true;
}
else
return true;
}

// returns number of columns in a sheet
public int getColumnCount(String sheetName){
// check if sheet exists
if(!isSheetExist(sheetName))
return -1;

sheet = workbook.getSheet(sheetName);
row = sheet.getRow(0);

if(row==null)
return -1;

return row.getLastCellNum();



}
//String sheetName, String testCaseName,String keyword ,String URL,String message
public boolean addHyperLink(String sheetName,String screenShotColName,String testCaseName,int index,String url,String message){
//System.out.println("ADDING addHyperLink******************");

url=url.replace('\\', '/');
if(!isSheetExist(sheetName))
return false;

   sheet = workbook.getSheet(sheetName);
 
   for(int i=2;i<=getRowCount(sheetName);i++){
    if(getCellData(sheetName, 0, i).equalsIgnoreCase(testCaseName)){
    //System.out.println("**caught "+(i+index));
    setCellData(sheetName, screenShotColName, i+index, message,url);
    break;
    }
   }


return true;
}
public int getCellRowNum(String sheetName,String colName,String cellValue){

for(int i=2;i<=getRowCount(sheetName);i++){
    if(getCellData(sheetName,colName , i).equalsIgnoreCase(cellValue)){
    return i;
    }
   }
return -1;

}

// to run this on stand alone
public static void main(String arg[]) throws IOException{

//System.out.println(filename);
Xls_Reader datatable = null;


datatable = new Xls_Reader("H:\\Student_Selenium_Workspaces\\Framework_Weekend\\src\\Framework_XL_Files\\Controller.xlsx");
for(int col=0 ;col< datatable.getColumnCount("TC5"); col++){
System.out.println(datatable.getCellData("TC5", col, 1));
}
}


}

Wednesday, December 10, 2014

TestNg_Reports

package customreports;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.testng.IReporter;
import org.testng.IResultMap;
import org.testng.ISuite;
import org.testng.ISuiteResult;
import org.testng.ITestNGMethod;
import org.testng.ITestResult;
import org.testng.xml.XmlSuite;

public class CustomReporter implements IReporter{

@Override
public void generateReport(List<XmlSuite> xmlSuites, List<ISuite> suites,
String outputDirectory) {

System.out.println("***********INSIDE CUSTOM REPORTER**************");
for(int suiteNum=0;suiteNum<suites.size();suiteNum++){
ISuite currentTestSuite = suites.get(suiteNum);
System.out.println("Test Suite Name -> "+ currentTestSuite.getName());
//System.out.println(currentTestSuite.getResults());
Map<String, ISuiteResult>  suiteResults = currentTestSuite.getResults();

Set<String> suiteResultKeys = suiteResults.keySet();
Iterator<String> suiteResultKeysIter= suiteResultKeys.iterator();

while(suiteResultKeysIter.hasNext()){
String testName = suiteResultKeysIter.next();
System.out.println("Test Name -> "+testName);
ISuiteResult testResult = suiteResults.get(testName);

IResultMap failedTests = testResult.getTestContext().getFailedTests();
IResultMap passedTests = testResult.getTestContext().getPassedTests();
IResultMap skippedTests= testResult.getTestContext().getSkippedTests();
ITestNGMethod[]  allTests = testResult.getTestContext().getAllTestMethods();
System.out.println("Test Method Names ->");

for(int testNum=0;testNum<allTests.length;testNum++){

if(failedTests.getAllMethods().contains(allTests[testNum])){
System.out.println(allTests[testNum].getMethodName() +" -- FAILED");
Collection<ITestNGMethod> allFailedMethods= failedTests.getAllMethods();
Iterator<ITestNGMethod> allFailedMethodsIter = allFailedMethods.iterator();

while(allFailedMethodsIter.hasNext()){
ITestNGMethod meth = allFailedMethodsIter.next();
if(allTests[testNum].getMethodName().equals(meth.getMethodName())){
Set<ITestResult> failures = failedTests.getResults(meth);
Iterator<ITestResult> failuresIter= failures.iterator();
while(failuresIter.hasNext()){
System.out.println("Reason = "+failuresIter.next().getThrowable().getMessage());
}
}

}

// reason
}else if(passedTests.getAllMethods().contains(allTests[testNum])){
System.out.println(allTests[testNum].getMethodName() +" -- PASS");
}else if(skippedTests.getAllMethods().contains(allTests[testNum])){
System.out.println(allTests[testNum].getMethodName() +" -- SKIPPED");
// reason
Collection<ITestNGMethod> allSkippedMethods= skippedTests.getAllMethods();
Iterator<ITestNGMethod> allSkippedMethodsIter = allSkippedMethods.iterator();

while(allSkippedMethodsIter.hasNext()){
ITestNGMethod meth = allSkippedMethodsIter.next();
if(allTests[testNum].getMethodName().equals(meth.getMethodName())){
Set<ITestResult> skips = skippedTests.getResults(meth);
Iterator<ITestResult> skipIter= skips.iterator();
while(skipIter.hasNext()){
System.out.println("Reason = "+skipIter.next().getThrowable().getMessage());
}
}

}
}



}


}


}
}

}
=====================================================

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite A">




<test name="Test A1">
    <classes>
        <class name="testSuiteA.TestA1" ></class>  
    </classes>
</test>

<test name="Test A2">
    <classes>
        <class name="testSuiteA.TestA2" ></class>  
    </classes>
</test>


</suite>

====================================================

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Suite B">


<test name="Test B1">
    <classes>
        <class name="testSuiteB.TestB1" ></class>  
    </classes>
</test>

<test name="Test B2">
    <classes>
        <class name="testSuiteB.TestB2" ></class>  
    </classes>
</test>


</suite>

======================================================

<suite name="My suite">
<listeners>
    <listener class-name="customreports.CustomReporter" />
</listeners>
  <suite-files>
 
   <suite-file path="./Suite_A.xml" />
    <suite-file path="./Suite_B.xml" />
  </suite-files>
</suite>
====================================================




package testSuiteA;

import org.testng.Assert;
import org.testng.SkipException;
import org.testng.annotations.Test;

public class TestA1 {

@Test
public void testA1_1(){
throw new SkipException("Skipping the test");
}
@Test
public void testA1_2(){
}
@Test
public void testA1_3(){
Assert.fail("failed test case ");
}
}
===================================

package testSuiteA;

import org.testng.Assert;
import org.testng.annotations.Test;

public class TestA2 {

@Test
public void testA2_1(){
}
@Test
public void testA2_2(){
Assert.fail("failed test case ");
}
@Test
public void testA2_3(){
}
}
=====================================

package testSuiteB;

import org.testng.Assert;
import org.testng.annotations.Test;

public class TestB1 {

@Test
public void testB1_1(){
}
@Test
public void testB1_2(){
}
@Test
public void testB1_3(){
Assert.fail("failed test case ");
}
}
=====================================

package testSuiteB;

import org.testng.Assert;
import org.testng.annotations.Test;

public class TestB2 {

@Test
public void testB2_1(){
}
@Test
public void testB2_2(){
Assert.fail("failed test case ");
}
@Test
public void testB2_3(){
}
}

Thursday, May 24, 2012

~Side Effects Of Freeeee Pool~


It was 10.30 Monday morning and I was still sleeping in my bed. I got no mood to get up and was thinking how I was till last Friday. As employee of an IT company my day starts with the status call at early morning and ends with the status call -midnight, where we will be giving the same status in different tone and modulation, but that's another story. Today, suddenly I got a feeling that I got cut off from the entire world, where no one to call me or at least to care about my bare existence in the company - I AM IN FREE POOL - BENCH


                                                       My Initial thought about bench!!!!!!!

 When I stepped into the company in the mid afternoon suddenly I got a feeling as though I am the one who has got no work to perform, but soon my thought changed when I stepped inside Library. I felt like the whole company is inside the tiny space where third generation computers were given to employees to check the mails and to browse, and to my surprise majority of people were freshers who were poking their managers through mail for the desired project.

Clearing this crowd I stepped inside book section where I was planning to read a book for a long time. The book was Guns,germs and steel by Jared Diamond, The book was all about the colonial mind set and how small number of people managed to control large Asian continent. But to my surprise I found the book in the hands of a girl who was eagerly staring at the cover along with his boy friend and he in turn was interested in some other thing which is not important here. Initially I thought of asking her for the book but later I don't want to disturb them either. I was roaming my campus aimlessly and hopelessly, just thinking how long I have to be like this and below are some of my weird observation


* You may desisted from entering the ODC, and your friends may suddenly see you as hacker and consider malevolence

* Your friends think that you are extremely free and they used to mention in their conversation often. I don’t know whether they are jealous of your status but sure the starting of the conversation will be as "Any how you are free Wright....". All your act will be considered futile

* Your friend task become your task. From collecting the courier to dispatching their bench items, you will treated as though you are born for it and have the ultimate desire to do it

* You will come to know about many good/bad pairs exists in your building and your floor. As I was in the bench, many of the time I prefer the stairs instead of Lifts and you can come across many embarrassing situation( and sure the embarrassing situation is for you and not for them- mind it ). And some days you can find the same pair altered and floors changed.

* Frequency of sending forward mails will be high from your end, and people may say upto your face that they will delete the mail without reading it, considering that mails send by the guy in the free pool will be junk and can be read and understood only by the person who is in free pool.

* Whatever the call you get, whether it may be the airtel or HDFC customer care, you will think the call is from the resource allocation team and may feel jittery. If your friends are crazy enough they may call you as HR and ask you to come to a certain place to get a Ice cream for them. Those were Imponderable moments.

* You will have the up to date knowledge to appear for IAS exam ,as you will be reading all news papers in your Library with utmost sincerity and commitment. And you will find the 40+ guys having all the important papers and refusing to give even classifieds paper also.

* You will have a special circle of people who in turn will be in bench for 1+ years and your gang will be easily conspicuous 

* Since you will be gem packed with your project work and will be missing most of the birthday parties, suddenly when you happen to meet your friend after long time, he will map your tummy with the free pool.


I am sure any IT engineer would have gone through these phase of being in bench and enjoyed their life to the fullest. But according to me those are reminiscent days and anybody should have these kind of relaxing period. But at the same time I cannot  Ignore my manager warning of recession, or the saying 'calm before the storm", but when we are underpaid for our job there is no wrong in enjoying your small gap to fullest.

Do all you wish in this period. Take a book of the pillow size and complete it, go to the place you have never been in your campus ( with a girl, if your company is a boy stay where you are) , call all your batch mate and see how they are now, take up a short duration course on any humanities studies.

Live it - Love it


~~~~ Scribbling Continues~~~





Monday, April 30, 2012

Capitalism: A Ghost Story



I am giving you the best article I have read in the recent time. Though some of the comments are not agreeably, its worth publishing....Happy Reading :) :)

Capitalism: A Ghost Story
Rockefeller to Mandela, Vedanta to Anna Hazare.... How long can the cardinals of corporate gospel buy up our protests?

Is it a house or a home? A temple to the new India, or a warehouse for its ghosts? Ever since Antilla arrived on Altamont Road in Mumbai, exuding mystery and quiet menace, things have not been the same. “Here we are,” the friend who took me there said, “Pay your respects to our new Ruler.”

Antilla belongs to India’s richest man, Mukesh Ambani. I had read about this most expensive dwelling ever built, the twenty-seven floors, three helipads, nine lifts, hanging gardens, ballrooms, weather rooms, gymnasiums, six floors of parking, and the six hundred servants. Nothing had prepared me for the vertical lawn—a soaring, 27-storey-high wall of grass attached to a vast metal grid. The grass was dry in patches; bits had fallen off in neat rectangles. Clearly, Trickledown hadn’t worked.

But Gush-Up certainly has. That’s why in a nation of 1.2 billion, India’s 100 richest people own assets equivalent to one-fourth of the GDP.

The word on the street (and in the New York Times) is, or at least was, that after all that effort and gardening, the Ambanis don’t live in Antilla. No one knows for sure. People still whisper about ghosts and bad luck, Vaastu and Feng Shui. Maybe it’s all Karl Marx’s fault. (All that cussing.) Capitalism, he said, “has conjured up such gigantic means of production and of exchange, that it is like the sorcerer who is no longer able to control the powers of the nether world whom he has called up by his spells”.

In India, the 300 million of us who belong to the new, post-IMF “reforms” middle class—the market—live side by side with spirits of the nether world, the poltergeists of dead rivers, dry wells, bald mountains and denuded forests; the ghosts of 2,50,000 debt-ridden farmers who have killed themselves, and of the 800 million who have been impoverished and dispossessed to make way for us. And who survive on less than twenty rupees a day.


Mukesh Ambani is personally worth $20 billion. He holds a majority controlling share in Reliance Industries Limited (RIL), a company with a market capitalisation of $47 billion and global business interests that include petrochemicals, oil, natural gas, polyester fibre, Special Economic Zones, fresh food retail, high schools, life sciences research and stem cell storage services. RIL recently bought 95 per cent shares in Infotel, a TV consortium that controls 27 TV news and entertainment channels, including CNN-IBN, IBN Live, CNBC, IBN Lokmat, and ETV in almost every regional language. Infotel owns the only nationwide licence for 4G Broadband, a high-speed “information pipeline” which, if the technology works, could be the future of information exchange. Mr Ambani also owns a cricket team.

RIL is one of a handful of corporations that run India. Some of the others are the Tatas, Jindals, Vedanta, Mittals, Infosys, Essar and the other Reliance (ADAG), owned by Mukesh’s brother Anil. Their race for growth has spilled across Europe, Central Asia, Africa and Latin America. Their nets are cast wide; they are visible and invisible, over-ground as well as underground. The Tatas, for example, run more than 100 companies in 80 countries. They are one of India’s oldest and largest private sector power companies. They own mines, gas fields, steel plants, telephone, cable TV and broadband networks, and run whole townships. They manufacture cars and trucks, own the Taj Hotel chain, Jaguar, Land Rover, Daewoo, Tetley Tea, a publishing company, a chain of bookstores, a major brand of iodised salt and the cosmetics giant Lakme. Their advertising tagline could easily be: You Can’t Live Without Us.

According to the rules of the Gush-Up Gospel, the more you have, the more you can have.

The era of the Privatisation of Everything has made the Indian economy one of the fastest growing in the world. However, like any good old-fashioned colony, one of its main exports is its minerals. India’s new mega-corporations—Tatas, Jindals, Essar, Reliance, Sterlite—are those who have managed to muscle their way to the head of the spigot that is spewing money extracted from deep inside the earth. It’s a dream come true for businessmen—to be able to sell what they don’t have to buy.
                                                                                                                                                                                                                                ……TO BE CONTINUED….