One test case that works on 2 identical websites

Quite new here so if I am posting in the wrong place please tell me so I can correct my mistake!

Anyway, I have 2 identical websites which both need automatic testing. Both websites have a different website address. I have one test case which I put in a test suite that I am running through a console. I am constantly switching the website address, which gets quite tedious after awhile (since I have to constantly generate a new script). So I am feeling I am doing something very wrong here.

If you have any advice on how to do this or any other tips that might help, that would be greatly appreciated!

Not so sure about your question but i’ll assume a similar setup as mine.
You have your website on 2 environment, one for development and one for release (public) for example. They are identical but only the url change.

I would say, add a global variable to the profile you are using, for example a variable named “url”. Use variable named “url” as the reference in your test case when you open the browser or navigate to the url.

Then, when you start your tests suite from the Test Suite in command line, you can define the variable you have set up since it’s Global. Use the parameter -g_url=“your url” to execute the test on another website.

Another work around is to have different execution profile, one for each website.

If you want to just compare 2 identical websites to find any visual difference, the following is my proposal.

Thank you so much! This was exactly what I needed. I really appreciate it.