Data sharing between the scenario is not allowed using dependency injection. In cucumber all the scenario must be independent of each other. However if there is such scenario where date need to share between scenario, then there are two ways to do the same [1] Use Background [2] Use Hooks
Note: This is not advisable and also not good practice