I have a suite of 15 test cases.
I now want to run them against a different Base URL.
Is there any way to change all 15 in one go?
So far what I have had to do is change each of them one-by-one which is slow and tedious.
I have a suite of 15 test cases.
I now want to run them against a different Base URL.
Is there any way to change all 15 in one go?
So far what I have had to do is change each of them one-by-one which is slow and tedious.
You can open all the test case xmls in a text editor.
You can even just edit the 'source' in the selenium IDE (see screenshot below).
Just remove the <link rel="selenium.base" href="http://dmstaff2.herokuapp.com/" />
in each test case and then they will use the url of whatever your firefox web browser has at that point.
[Edit - please note my answer for important info about doing this! Michael(OP)]
Try this method and changing URLs should not be an issue - http://greenlanternautomationframework.blogspot.com/p/selenium-ide.html We are constantly using environments QA1 or QA2 or localhost and all that jazz. So, it helps to make all the test cases independent of the URL and then add a URL. Check out the whole tutorial for a clear picture or Skip to section - 04_GoToURL
You can create a properties file.
In this properties file you declare a URL variable.
You can then get this variable through this properties file to set the url base.
More experience has turned up the following:
Yes you can (and should) remove the HEAD references as amey indicated.
However you will find the behaviour extremely confusing because:
When you change the Base URL to something new you frequently need to exit and re-enter Selenium in order for that to always be applied to all the other cases.
If you change the Base URL for a case that isn't the first Test Case you will likely have problems. Addres this for now by changing the Base URL for the first Test Case in the suite, save the suite, exit Selenium and re-enter.
There's clearly some bugs in Selenium that make changing the Base URL vcery confusing but once you know the pitfalls to avoid you can make the changes successfully.
Since none of the solutions mentioned it, here is my solution.
Download BK ReplaceEM
For each Selenium IDE file replace the following:
from:
link rel="selenium.base" href="<OLD URL BASE>"
to:
link rel="selenium.base" href="<NEW URL BASE>"
Our selenium tests are executed automatically by the CI-tool with a command like:
java -jar selenium-server-standalone-2.46.0.jar -htmlSuite "*firefox" "$SITE_URL" "$BUILD_PATH/$TEST_PATH" "$ARTIFACTS_PATH/selenium-results.html"
where
$SITE_URL
- the URL to the site being tested, effectively this value is a base url$BUILD_PATH/$TEST_PATH
- the path to the test suite$ARTIFACTS_PATH/selenium-results.html
- the path to test results, i.e. the results of selenium run.At the same time none of our tests contains <link rel="selenium.base" href="http://www.example.com/" />
, to achieve the same - remove it from existing tests and remove it from selenium IDE template:
<link rel="selenium.base" ...
line from there.