I have a set of Selenium tests which run via HTTP – I’d like to run the same tests under HTTPS aswell as HTTP with as little duplication as possible. I guess other people must already be doing this? I use the Java Selenium Remote Control – but I can probably translate a method from another language.
Share
You could pass the URL of the application under test to your test framework as a parameter, or store it in a properties file. I do this to switch between test environments.
Below is a simple example of reading from a properties file:
And an example of using a parameter (I use TestNG for this):
Add parameters in the TestNG suite XML file:
Use the parameter when you create a Selenium instance: