Selenium IDE Base URL and Open Commands

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

I have this URL as the base URL of http://test.info:50/test and in the open command when I use part / test of the url, so the url to open should be http: / /test.info:50/test/test (which is not the actual URL), and selenium continues to use the script at the base URL above and shows no errors.

So my question is using a base url when it can be empty or empty. What is the use of the Open command when I used the full URL in the base URL part.

Hope the question is clear. Please, help.

+6
source share
3 answers

The base URL should be the index of your site. NOT a checked directory.

For instance,

BaseURL: http://google.com/ Open: /search 

This will open http://google.com/search as the starting Url. From now on, you should continue testing.

In your case, specify

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

And you will be golden.

EDIT:

and selenium continues to run the script at the base URL above and shows no errors.

The Selenium IDE will not show errors because the Selenium IDE does not care where your test runs. He is not limited to this (and should not). It will only spit out an error because something is wrong in your script. Nothing to do with opening links. You can open something like /somebullcrapdirectory and everything will be fine. This would be unsuccessful in any subsequent steps, though, since /somebullcrapdirectory actually be an invalid directory.

+6
source

I hope you understand Abhi

When the user gives an empty base url, after which an error occurs, [warn] The base URL is not set. Updating the base URL from the current window. [error] baseUrl was not absolute:

0
source

The URL specified in the input field of the base URL in the Selenium IDE and the URL specified in the target parameter of the open command are not just combined. Opening /test/ will only be considered an absolute URL for your domain.

However, you can specify the target ./test/ , which, as I said, asks for http://test.info:50/test/test/ . I find this very useful, as in some environments my web application will be in the root and in some other environments in the base path, for example / myapp /.

Regarding the empty base URL, I assume that it worked because the browser page on which the test was running already showed the page from the correct domain. If you run the open command on a page on any other site, the open command would request the / test / page from that site. After that, this base URL would point to this site.

0
source

Source: https://habr.com/ru/post/957813/


All Articles