How to create a robust BDD framework? Can you suggest any reference for building the framework

I am working on to create a BDD framework and integrating with CI-CD pipeline. I am facing a challenge to test the application with the data provided from Cucumber. To solve this problem, different approaches came into my mind. But, it has its own limitations.So, I am just jotting down my approaches here and if somebody has any better and concrete approach what they are following in their project then please feel free to share your thoughts.

Approach 1
=============
Dedicating one controlled testing database from where application will fetch the data. I can have same set of data in my feature file which is already available to test the application

Problems
==============
The major problem in this approach is that once the application is hosted, if automation script is performing any saving, deletetion,updation operation on the screen then data in database is getting changed. That means if we want to run the same automation scripts next time then manually we have to again change the input data in cucumber file to test the application as data in database got changed in the first run. If we are using this approach then this can not be used for CI-CD as automation scripts execution is automatically trigerred by Jenkins on the scheduled time and script will be started getting failed.

Approach 2
=============
Another approach is before executing the actual automation script, I can make sure a file contains insert scripts which gets executed by automation script first to load thsese data end to end and if this record already exist then I can first delete and insert it again freshly. I can use the same set of data in cucumber file as input which got inserted. In this way database will always have data against which I want to test the application.

Problems
=============
It requires a lot of maintainability as each time if there is any change in the column or table, insert script has to be updated and I also feel it will drastically increase the total run time of the automation scripts

Any Suggestions?
==============
Can somebody mention here how they handle this kind of cases in their projects? I there any better approach to handle this case?

Default Asked on February 17, 2019 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.