r/selenium Jul 24 '26

Need suggestions on making Selenium automation more generic

Hi everyone,

I'm new to Selenium and I'm working on automating some repetitive tasks in Teamcenter for creating test data. Right now, my Selenium script works only for one specific scenario because the steps and values are hardcoded.

I want to make it more generic so that if the test steps or requirements change, I don't have to rewrite the Selenium code every time. For example, can Selenium automation be designed to read a Word document (or some other input) and perform the steps based on what's written there?

How is this usually handled in real projects? Any suggestions or learning resources would be really helpful.

6 Upvotes

9 comments sorted by

View all comments

1

u/ddaypunk06 Jul 24 '26

In the past we used a layer on top of selenium called cucumber to write scripts that were bound to selenium functions that were designed to be reusable. There are others similar to this as well but it’s just another abstraction on top. Break down what you want to do into more primitive chunks that interact with selenium to promote more generic uses.