0

I have implemented a shared Test Context between Cucumber Step Definitions using PicoContainer.

Please find the complete code which I have written in the below shared drive.

https://drive.google.com/file/d/1bBxOJDW7auqN_CX9tc0KEDo-TiPzew6m/view?usp=sharing

Before implementing PicoContainer i have only one Step definition class after implementing it I created two separate step def classes for Home Page and Login Page.

Please find the below feature which i am automating. After i implemented share Test Context only first scenario is running successfully, while running Second scenario New browser is opening then failing it with NullPointerException.

Feature: Login Action

 Scenario Outline: Successful Login with Valid Credentials
    Given User is on Home Page
    When User Navigate to LogIn Page
    And User enters "<username>" and "<password>"
    Then Message displayed Login Successfully
    Examples:
    | username   | password |
    | username@gmail.com | userpassword |


Scenario: Successful LogOut
    When User LogOut from the Application
    Then Message displayed LogOut Successfully

Please help me to fix this issue..

Marit
  • 2,399
  • 18
  • 27
testerwaitz
  • 103
  • 2
  • 9

0 Answers0