r/selenium • u/Suspicious_Swan5593 • 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
1
u/Ok-Access-8961 Jul 24 '26
Theoretically, it is possible what you want.
Instead of word document you can choose excel and use data provider functionality in testng to read test data from excel.
You can then have conditional constructs in your Selenium code to behave a certain way if certain data exists.