title: How to not Hard code the program in java? Used property file. But unable to use it with multiple xpaths?
body: <p>Scenario: Download a new month report from the site.</p>
  
  <p>Month.txt: Oct(2015) Unconventional wells</p>
  
  <p>Here is the structure:</p>
  
  <p>config.properties:</p>
  
  <pre><code>#browser
  browser=http://www.depreportingservices.state.pa.us/ReportServer/Pages/ReportViewer.aspx?%2fOil_Gas%2fOil_Gas_Well_Historical_Production_Report
  #drop-down box
  list_box= .//*[@id='ReportViewerControl_ctl04_ctl03_ddValue']
  #view report button
  view_report = .//*[@id='ReportViewerControl_ctl04_ctl00']
  #save button
  save_button = .//*[@id='ReportViewerControl_ctl05_ctl04_ctl00_Button']
  #csv button
  csv_button = .//*[@id='ReportViewerControl_ctl05_ctl04_ctl00_Menu']/div[2]/a
  #read path
  read_path = E:\\Ashik\\wkspSelenium\\PropertyPractice\\src\\package1\\Month.txt
  #write path
  write_path = E:\\Ashik\\wkspSelenium\\PropertyPractice\\src\\package1\\Month.txt
  </code></pre>
  
  <p>Implementation.java:</p>
  
  <pre><code>package package1;
  
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.IOException;
  import java.util.List;
  import java.util.Properties;
  
  import org.openqa.selenium.By;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.WebElement;
  import org.openqa.selenium.firefox.FirefoxDriver;
  import org.openqa.selenium.firefox.FirefoxProfile;
  
  import package1.Fileaccessing;
  
  public class Implementaion {
  
      public static  WebDriver driver;
      public  FileInputStream fis;
      public static String propertyfilepath="config.properties";
      public String browserName;
  
      //To get a key value from property file
      public String getProperty(String key) throws IOException, FileNotFoundException{
          fis=new FileInputStream(propertyfilepath);
          Properties prop=new Properties();
          prop.load(fis);
          return prop.getProperty(key);
  
      }
      public  static void initiate_webdriver() throws IOException
      {   
           // Changing default file downloading location  path using the FirefoxProfile.setpreference method.
            FirefoxProfile fprofile = new FirefoxProfile();   
            fprofile.setPreference("browser.download.folderList",2);
            fprofile.setPreference("browser.download.manager.showWhenStarting",false);
            //file download path
            fprofile.setPreference("browser.download.dir", "E:\\"); //need to ask muthu
            //CSV format to download the data
            fprofile.setPreference("browser.helperApps.neverAsk.saveToDisk", "text/csv");
            //Automatically downloads the file without manual selection
            fprofile.setPreference("browser.helperApps.alwaysAsk.force",false);
            fprofile.setPreference("browser.download.manager.showAlertonComplete",false);
            fprofile.setPreference("browser.download.manager.closeWhenDone",false);
            //Assigning the created profile to Firefox driver
  
            WebDriver driver=new FirefoxDriver(fprofile);
      }
  
      //To get a url in browser
          public  static void get_url(String link) throws InterruptedException
          {
  
  
              driver.get(link);
              driver.manage().window().maximize();
          }
  
          //To select a value by visible text in a drop down
  
  
           public static void downloads_new_month(String xpath, String value)  throws InterruptedException
           {
                WebElement mSelectElement = driver.findElement(By.xpath(xpath));
                List&lt;WebElement&gt; optionsList = mSelectElement.findElements(By.tagName("option"));
                Fileaccessing fileAccessObject = new Fileaccessing();
                //Reading txt from the Month txt file
                String oldMonth = fileAccessObject.getTheOldMonthFromFile(propertyfilepath);
                System.out.println("The old month is: " + oldMonth);
                String newMonth =""; 
  
                for (int i = 2; i &lt; optionsList.size(); i++) {
  
                WebElement element = optionsList.get(i);
                newMonth = element.getText();
  
                //Message that prints the new month
                System.out.println("The new month is:"+newMonth);
  
  
                /*Condition to check if the New month is equal to Old month, if it is not equal then proceeds
                 * to download that particular month data or else breaks the loop
                 */
  
                if (oldMonth.equals(newMonth)) {
                System.out.println("No new months are available to download");
                driver.close();
                break;
                }else if (i==2 &amp; !(oldMonth.equals(newMonth))) {
                //else if (!(oldMonth.equals(newMonth))) {    
                element.click();
                  //Click on View Report button
                driver.findElement(By.xpath(xpath)).click();
                  //Wait time to load the selected month data
                Wait(20000);} 
                public static   saveButton(String xpath2 , String value2)   throws InterruptedException{
                  //Click on File save button
                  driver.findElement(By.xpath(xpath2)).click();
                  //wait time to load the File format options
                Wait(20000); } 
           public static void csvButton(String xpath3 , String value3) throws InterruptedException{
                  //Click on csv format button
                driver.findElement(By.xpath(xpath3)).click();
                Wait(10000);
                  //Success message to indicate that the data is downloaded successfully in csv format
                System.out.println("New Month data downloaded in csv format:" + newMonth);
           }
                //Saves the new month txt to the file
           public static void save_new_month() {
                fileAccessObject.saveIntoAFile(newMonth, propertyfilepath);
                //closes the web page once the file is downloaded
                driver.close();
                break;
           }
          } }
  
  
  
           public static void Wait(int time){
  
              try {
                  Thread.sleep(time);
                  } catch (Exception e) {
          // TODO: handle exception
          } } 
  }
  </code></pre>
  
  <p>I have successfully set up browser initialization and opening, now how to use it in download_new_month method, as there are 3 xpath's has to be clicked to download a report when condition is met. Please help.</p>