Newbie here so hoping you can bear with me!
Although new to automation in my new job, I have done a fair bit of reading on it. But I find myself thrown in the deep end here and have the task of setting up a framework. I am also new to coding.
We have some retrospective automation to set up to allow us to go BDD for future delivery. I am writing some feature files for existing behavior and writing the automation tests on the UI with Selenium in Java.
I am writing my locators and various page objects to interact with my page into a page class so I'm using an OOP approach for the framework. Examples being a method to populate field A, a method to populate field B, a method to click submit. The field methods will allow a string to be passed in.
A lot of guides I read on cucumber talk about passing in a string value from the feature file into the step def and then into the page object method that interacts with the field.
Now what if I am not interested in that value to be passed in and in fact the field isn't even mentioned in the feature file? But I still need to populate this field just to get me through my scenario. My Feature File will actually just read "Complete registration form" but I'm not bothered about what values to complete it with for this particular scenario.
Do I just pass in any value to the page methods at the step def stage? Eg. hard code any value at step def level? I'm worried that this may be bad practice and that there is a better way.
.properties
file. It will act like a constant but you can always override it.