title: cucumber giving null pointer exception with multiple scenario in feature file
body: <p><strong>Test Steps</strong></p>
  <pre><code>public class TestSmoke {
          WebDriver driver;
          @Given(&quot;^open firefox and start application$&quot;)jjj
          public void open_firefox_and_start_application() throws Throwable {
              driver=new FirefoxDriver();
              driver.manage().timeouts().implicitlyWait(40, TimeUnit.SECONDS);
              driver.get(&quot;https://example.com&quot;);
              
          }
      **Scenario 1**
          @When(&quot;^I click on Login$&quot;)
          public void I_click_on_Login() throws Throwable {
              driver.findElement(By.xpath(&quot;//a[contains(.,'Login')]&quot;)).click();
              
          }
      
          @When(&quot;^enter valid \&quot;([^\&quot;]*)\&quot; and valid \&quot;([^\&quot;]*)\&quot;$&quot;)
          public void enter_valid_and_valid(String uname, String pass) throws Throwable {
              driver.findElement(By.id(&quot;Username&quot;)).sendKeys(uname);
              driver.findElement(By.id(&quot;Password&quot;)).sendKeys(pass);
              
          }
      
          @Then(&quot;^Click on login and User should be able to login successfully$&quot;)
          public void Click_on_login_and_User_should_be_able_to_login_successfully() throws Throwable {
              driver.findElement(By.id(&quot;loginUser&quot;)).click();
              
          }
  </code></pre>
  <p>jkjbjkkjhjknjkbjkhjkbjbjbbjbnmbbnmb</p>
  <pre><code>        **Scenario 2:**
          @Given(&quot;^Click on shop for carts$&quot;)
          public void Click_on_shop_for_carts() throws Throwable {
              hhjbhbhgjbkjbhlhihjbhbb
              driver.findElement(By.xpath(&quot;//span[text()='Shop for Parts']&quot;)).click();
              
          }
      
          @Given(&quot;^select plates$&quot;)
          public void select_plates() throws Throwable {
              driver.findElement(By.xpath(&quot;//a[contains(.,'Plates ')]&quot;)).click();
              
          }
      
          
          @When(&quot;^I click on drsired product$&quot;)
          public void I_click_on_drsired_product() throws Throwable {
              driver.findElement(By.xpath(&quot;//a[@data-itemnumber='PLT01096096046']&quot;)).click();
          }
      
          @When(&quot;^click on item increment$&quot;)
          public void click_on_item_increment() throws Throwable {
              WebElement ele=driver.findElement(By.xpath(&quot;//i[contains(@class,'fa fa-caret-up')]&quot;));
              for(int i=0;i&lt;=3;i++)
              {
                  ele.click();
              }
              
          }
      
          @When(&quot;^Click on buy now$&quot;)
          public void Click_on_buy_now() throws Throwable {
              driver.findElement(By.xpath(&quot;//button[contains(.,'Buy Now')]&quot;)).click();
              
          }
      
          @Then(&quot;^Product should be added to the cart successfully$&quot;)
          public void Product_should_be_added_to_the_cart_successfully() throws Throwable {
              
              
          }
  </code></pre>
  <p><strong>Feature File</strong>
  Feature: Test test Smoke scenario</p>
  <pre><code> Scenario: Test login with valid credentials
      Given open firefox and start application
      When I click on Login
      And enter valid &quot;s@yopmail.com&quot; and valid &quot;passw0rd&quot;
      Then Click on login and User should be able to login successfully
      
      
      Scenario: Test shop for cart
      Given Click on shop for carts
      And select plates
      When I click on drsired product 
      And click on item increment 
      And Click on buy now
      Then Product should be added to the cart successfully
    
  </code></pre>
  <p><strong>Test runner</strong></p>
  <pre><code>@RunWith(Cucumber.class)
  @Cucumber.Options(features=&quot;features&quot;,glue={&quot;steps&quot;})
  public class TestRunnr { 
  </code></pre>
  <p>While i am running this cucumber script its throwing an NullPointer Exception :</p>
  <pre><code>java.lang.NullPointerException
      at steps.testmoke.Click_on_shop_for_carts(testSmoke.java:47)
      at ?.Given Click on shop for carts(MyApplication.feature:11)
  </code></pre>
  <p>First scenario is executing successfully but second scenario is not executing.I am login in a ecommerce website and try to click on shop for parts .</p>