Is there any way to create a common variable at the feature file level & use it across scenarios instead of hardcoding as below for each step in cucumber feature files using java
eg:
Feature: Test
Scenario: scenario 1
Given a user
When get request is sent to "url"
Then response code is 200
Scenario: scenario 2
Given a user
When get request is sent to "url"
Then response code is 200
Want to do something like this
eg:
Feature: Test
global_variable_url=url
Scenario: scenario 1
Given a user
When get request is sent to "<global_variable_url>"
Then response code is 200
Scenario: scenario 2
Given a user
When get request is sent to "<global_variable_url>"
Then response code is 200