Skip to main content

Posts

Showing posts with the label command line

Control Linux Box using Terminal

You can shutdown, restart a linux box from Terminal. You can use the following commands to do so Open Terminal Type in “ sudo restart ” to restart the system Sometimes you may get the error “command restart not found” if you get this error then try the commands using sudo /sbin/restart or sudo /sbin/shutdown –r now   Get more help on shutdown command using man shutdown

Useful Windows Commands

ipconfig : Used to see the IP address and the gateway mask. Can also be used to ipconfig /all : Displays all the available information for a system ipconfig /displaydns : This will display the local dns file ipconfig /flushdns : This command will clear the local dns file systeminfo : Get the operating system information using this command systeminfo /S <systemname> /U <username> : Get the operating system information for a remote system using this command tasklist : Does the same thing that starting a task manager would do…Display a list of tasks running on the system. taskkill /im <imagename> : Kills the process with the image name provided taskkill /pid <processid> : Kills the process with the process id provided type : read a file from command line using type… netstat : You can get to know who/what is getting connected to your system   netstat –a: displays all connection info netstat –b : displays the executable name in the netstat outpu...

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!!!!

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  -Durl=