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=
Being in the industry for almost two decades, one thing that's been constant is change and my curiosity. I In this fast world of IT...being curious, learning and learning by doing is quintessential :) Here is my way of learning and sharing what I learnt!!! Author: Sirisha Reddy G V