Abhi
Abhi

Reputation: 107

Selenium IDE Base URL and Open commands

What is the use of Base URL is Selenium IDE because even when I enter the wrong URL there or leave it blank, and run the script, it just runs fine.

I have this URL, as base URL http://test.info:50/test and in the open command when I use the part /test of the URL, so the URL to be opened should be http://test.info:50/test/test (which is not the actual URL) and selenium keeps running the script on the Base URL above and shows no error.

So, my question hear is what is the use of Base URL when it could be left blank or empty. What is the use of the Open command when I have used the full URL in the Base URL part.

Hope the question is clear. Please help.

Upvotes: 6

Views: 16629

Answers (4)

Akshay Chopra
Akshay Chopra

Reputation: 1253

Selenium IDE use Base Url example

We can simply use the open command and leave the target section blank.
This will use the base URL and open it.

Upvotes: 1

R. Schreurs
R. Schreurs

Reputation: 9065

The URL specified in Base URL input field in de Selenium IDE, and the URL specified in the target parameter of the open command, will not just simply be concatenated. Opening /test/ will just be seen as an absolute URL for your domain.

You can, however, specify a target ./test/, which requests, as I experienced, requests http://test.info:50/test/test/. I find this very useful, as in some environments, my web application will reside on the root and in some other environments in a base path like /myapp/.

With respect to a blank Base URL, I assume that this worked because the browser page in which the test was run already showed a page from the correct domain. If you would have executed the open command on a page in any other site, the open command would have requested the page /test/ from that site. After that, that base URL would have pointed to that site.

Upvotes: 0

ddavison
ddavison

Reputation: 29032

The base URL should be the index of your site. NOT the directory under test.

For example,

BaseURL: http://google.com/

Open: /search

This will open http://google.com/search as the beginning Url. From then, you should continue testing.

In your case, specify

BaseURL: http://test.info:50/

Open: /test

And you'll be golden.

EDIT:

and selenium keeps running the script on the Base URL above and shows no error.

Selenium IDE will show no errors because Selenium IDE doesn't care where your test is ran.. it's not limited to that (nor should it be). It will only spit out an error for something is wrong in your script. Nothing to do with your opening of urls. You could open something like /somebullcrapdirectory and it'd still be fine. It'd fail at the point of performing any subsequent actions though, since /somebullcrapdirectory would actually be an invalid directory.

Upvotes: 6

faisal
faisal

Reputation: 81

I hope you understand Abhi,

When user give the blank base url after that comes the error, [warn] Base URL is not set. Updating base URL from current window. [error] baseUrl wasn't absolute:

Upvotes: 1

Related Questions