0

I've create a .bat file to open multiple Selenium tests (with Selenium RC), using url parameters (computername).

The problem is that the command parameter base-url is overwritten by the Test Suite open Command's url.

I know the parameter of the base-url file can be a dummy url since it's overwritten by the test suite but how can I manage to use that base-url parameter?

The app_path variable bellow is the base-url I want to use:

SET app_path="http://myApplication.com?Rank=%param%&Computer=%computername%"
START java.exe -jar %seleniumserver_path% -htmlSuite "*firefox" %app_path% %suite_path% %result_path% -port %unique_port%

From what I have red here http://www.yoyobrain.com/flashcards/show/64136:

purpose of baseURL GET parameter, what does it accept and what is default

(Answer)

if the "open" command uses a relative URL, we'll make it absolute by using this base URL.

This URL MUST be an absolute URL , i.e. it should start with "http://" or "https://", and it should point to a directory, i.e. the URL path should end with "/". (If the URL does NOT end in /, we'll automatically chop off the last part of the path, e.g. "http://foo/bar" will be treated as "http://foo/".)

Accepts absolute URL and defaults to the absolute URL of the test suite specified in the test parameter

So now my question is: How can I achieve to pass a parameter FROM Selenium RC to my TestSuite?

Francis P
  • 13,377
  • 3
  • 27
  • 51

1 Answers1

0

I managed to find the answer and I'll share if anyone runs in the same issue:

In your first test case, you can manage to get the selenium base-url that was used. To do so, store the selenium.browserbot.baseUrl value and then use that value for you open command:

<tr>
  <td>storeEval</td>
  <td>selenium.browserbot.baseUrl</td>
  <td>MyBaseUrl</td>
</tr>
<tr>
  <td>open</td>
  <td>${MyBaseUrl}</td>
  <td></td>
</tr>
Francis P
  • 13,377
  • 3
  • 27
  • 51