Skip to main content


Showing posts from October, 2011

Useful Linux Commands - II

How to get my linux box IP Address?/sbin/ifconfig - Use this command to get it :) /sbin/ifconfig | lessUnder Linux based systems you can use: ip addr showmount/umountUse this command to mount an external drive/folder

TestNG Error: Reference testng-impl-classpath not found

When we are running testng ant tasks we might get this error: 
"Reference testng-impl-classpath not found"

You should look at the testng.xml file you are using for testng to pick up your classes from!!!
Like mine has the following: 

Now you should check if your classes mentioned in the file are found at the exact path..
I have a mistake in the path. My classes are found under Panels.LeftPanels.Barrel.TestBookBox
Thus the error.

So solution: Check if you have any mistake in the class path you mentioned!!!!

ssh connection refused on port 22

When we are trying to access another linux box using ssh we might get this error:
ssh error: connection refused on 22

Hit this command: ps aux | grep sshIf you get two entries which list sshd and ssh-agent then it means ssh is running on your machineKill those connectionsStart your ssh again

This should resolve the issue!!!!
If you have resolved it in any other way, please leave a comment. Thanks!

Working with User Defined Properties using ANT

Its quite useful to work with user defined properties using ANT.
Lets say you have a build.xml in which you want to run a target based on a user input...In my case I want to decide on which URL to pass to Selenium based on the user selection of the stage to run the tests against...

Add the following to the build.xml: 

Now you can access the property from your program as 
String urlString = System.getProperty("url");

If you are using TestNG framework, then you should add the property to your ant task in the build.xml file as: 

To send this property from command line, you should send the property as 

Useful Linux Commands - I

Want to know your system name?/bin/uname -nKnow where you are in your file system: pwd The command will print Present Working DirectoryHow do you create a shortcut in linux?lnHow to extract compressed files?tarDownloading from a link can't be faster on any other OS :) wgetForgot which commands you ran?historyWant to see whats your disk space usage?df df -h gives human formatted listingMost important command to know more about the above commands - Need more help about the commands?man