title: How to get scenario name from a scenario outline in cucumber using java
body: <p>Suppose I have a test case like -</p>
  
  <pre><code>*Scenario: Facebook login test
  GIVEN I am a Facebook user
  WHEN I enter my user name &amp; password
  THEN login should be successful*
  </code></pre>
  
  <p>How could I get the scenario name from the step definition methods corresponding to "I am a Facebook user" or "I enter my user name &amp; password" or "login should be successful" ?</p>
  
  <p>Step definitions methods are -</p>
  
  <pre><code>@Given("^I am a Facebook user$")
  public void method1() {
   //some coding
   //I want to get the scenario name here
  }
  
  @When("^I enter my user name &amp; password$")
  public void method2() {
   //some coding
   //I want to get the scenario name here
  }
  
  @Then("^login should be successful$")
  public void method3() {
   //some coding
   //I want to get the scenario name here
  }
  </code></pre>