here is my script. In my Junit tests in many places, I need to specify a username, description, URL, invalid URL, etc. Therefore, I hard-coded these values. Good hard coding everywhere. So I want to move these values ββto a central location (file). And I have some data provider that says DP. I can call DP.getUserName (), DP.getUrl (), etc. In those places where these values ββare needed. Also, I want to have a pool of different usernames, URLs, invalid URLs, etc. When I call getUrl, it will randomly receive from the pool.
What I can come up with is to use java.util.Properties to load the propertis from the file, and every time I call, I just accidentally return one entry.
Any best approach to achieve this? thank.
David source
share