title: Using gherkin with Java. Copy @Given tag value as sting
body: <p>I got a gherkin+java tests and ExtentReports to generate reports. I found couple solutions to print out my ExtentReports in gherkin format as well. So, I used <a href="https://github.com/anshooarora/extentreports-java" rel="nofollow noreferrer">https://github.com/anshooarora/extentreports-java</a> for BDD. The problem is that I got code like:</p>
  
  <pre><code> @Given("^I navigates to My Account page$")
      public void I_navigates_to_My_Account_page() throws Throwable {
          com.aventstack.extentreports.ExtentTest given = scenario.createNode(new GherkinKeyword("Given"), "I navigates to My Account page").info("info");
  </code></pre>
  
  <p>But I would like not to copy @Given value and to use it's value and use a variable instead like:</p>
  
  <pre><code>@Given("^I navigates to My Account page$")
          public void I_navigates_to_My_Account_page() throws Throwable {
              com.aventstack.extentreports.ExtentTest given = scenario.createNode(new GherkinKeyword("Given"), getGivenText()).info("info");
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/EybrM.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EybrM.jpg" alt="snapshot"></a></p>
  
  <p>where getGivenText will receive "I navigates to My Account page" value on execution. I tried ti find solution for this, but no success. If anybody had this problem and found solution, please, let me know. Thank you!</p>