title: Need to pass parameter for multiple links to test in cucumber
body: <p>I have written this feature file for testing multiple links in home page.I was trying to reduce number of step definitions by trying to pass parameter through feature file.
  I am facing problem in writing element name in feature file which can fetch every tab.There is no id mentioned so I had to take xpath(which I know is not ideal to mention in feature file" .Can u suggest any alternate way to it?</p>
  
  <p>Homepage.feature</p>
  
  <pre><code>  Scenario: To Test Home Tab
        Given I am on Homepage
        When I Click on ".//*[@id='oneHeader']/div[3]/div/div[2]/nav/ul/li[1]/a/span"
        Then I am on "Home"
        And application should be closed
  
    Scenario: To Test Calender Tab
      Given I am on Homepage
      When I Click on "Calender"
      Then I am on "Calender"
      And application should be closed
  
    Scenario: To Test Lead Tab
      Given I am on Homepage
      When I Click on "Leads"
      Then I am on "Leads"
      And application should be closed
  
    Scenario: To Test Oppurtunities Tab
      Given I am on Homepage
      When I Click on "Oppurtunities"
      Then I am on "Oppurtunities"
      And application should be closed
  
    Scenario: To Test Accounts Tab
      Given I am on Homepage
      When I Click on "Accounts"
      Then I am on "Accounts"
      And application should be closed
  
  
    Scenario: To Test Contacts Tab
      Given I am on Homepage
      When I Click on "Contacts"
      Then I am on "Contacts"
      And application should be closed
  
    Scenario: To Test Dashboard Tab
      Given I am on Homepage
      When I Click on "Dashboards"
      Then I am on "Dashboards"
      And application should be closed
  
    Scenario: To Test Reports Tab
      Given I am on Homepage
      When I Click on "Reports"
      Then I am on "Reports"
      And application should be closed
  </code></pre>
  
  <p>Step Definition look like this</p>
  
  <pre><code>package stepDefination;
  
  import cucumber.api.java.en.Given;
  import cucumber.api.java.en.Then;
  import cucumber.api.java.en.When;
  import org.openqa.selenium.By;
  import org.openqa.selenium.WebDriver;
  import org.openqa.selenium.firefox.FirefoxDriver;
  
  public class SmokeTest {
      WebDriver driver;
  
      public SmokeTest() {
      }
  
      @Given("^Open firefox and start application$")
      public void Open_chrome_and_start_application() throws Throwable {
          this.driver = new FirefoxDriver();
          this.driver.manage().window().maximize();
          this.driver.get("http://test.salesforce.com/");
      }
  
      @When("^I enter valid \"([^\"]*)\" and valid \"([^\"]*)\"$")
      public void I_enter_valid_and_valid(String unam, String pass) throws Throwable {
          this.driver.findElement(By.xpath(".//*[@id=\'username\']")).sendKeys(new CharSequence[]{unam});
          this.driver.findElement(By.xpath(".//*[@id=\'password\']")).sendKeys(new CharSequence[]{pass});
      }
  
      @Then("^I should be able to login successfully$")
      public void user_should_be_able_to_login_successfully() throws Throwable {
          this.driver.findElement(By.id("Login")).click();
      }
  
      @Given("^I am on Homepage$")
      public void i_am_on_Homepage() throws Throwable {
          this.driver.findElement(By.xpath(".//*[@id=\'salesforceLogo\']"));
      }
  
      @When("^I Click on \"([^\"]*)\"$")
      public void i_Click_on(String Link) throws Throwable {
          this.driver.findElement(By.id(Link)).click();
      }
  
      @Then("^I am on \"([^\"]*)\"$")
      public void i_am_on(String Tab) throws Throwable {
          this.driver.findElement(By.id(Tab));
      }
  
      @Then("^application should be closed$")
      public void application_should_be_closed() throws Throwable {
          this.driver.quit();
      }
  }
  </code></pre>