If we sum up the OPs question as:
Can I use Selenium to test multiple URLs?
Then the answer is: Yes.
Like with most questions in Selenium, the answer, in part, is using Page Objects (POMs). I'd setup any repeatable code in a Page Object that you then use in your test files.
An example with the OPs question, I'd setup a navigation class that loads each URL; separate classes with page elements and methods that represent the different pages you navigate to; a utilities method that handles screenshots. So far, none of this is using loops.
With the test files, I'd have one test file for each URL. Use a beforeAll
to open the URL that calls your navigation class; have one or many test methods that perform some operation; have an afterTest
which takes a screenshot after each test. Again, repeat this for as many URLs you need to test. This then allows the test runner to run all the tests. Again, no loops are needed.
If you don't want or need separate test files for each URL, then you can handle URL reload on each test method.