6

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.

4

4 回答 4

6

基本 URL 应该是您网站的索引。不是被测目录。

例如,

BaseURL: http://google.com/

Open: /search

这将http://google.com/search作为起始 URL 打开。从那时起,您应该继续测试。

在您的情况下,请指定

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

Open: /test

你会是金色的。

编辑:

并且 selenium 继续在上面的基本 URL 上运行脚本并且没有显示错误。

Selenium IDE不会显示任何错误,因为 Selenium IDE 不关心您的测试在哪里运行。它不仅限于此(也不应该如此)。它只会在您的脚本中出现错误时吐出错误。与您打开网址无关。你可以打开类似的东西/somebullcrapdirectory,它仍然可以。但是,它在执行任何后续操作时都会失败,因为它/somebullcrapdirectory实际上是一个无效的目录。

于 2013-11-11T16:10:54.613 回答
1

我希望你理解阿比,

当用户在出现错误之后给出空白基本 URL 时,[警告] 基本 URL 未设置。从当前窗口更新基本 URL。[错误] baseUrl 不是绝对的:

于 2013-11-11T12:53:15.507 回答
1

Selenium IDE 使用 Base Url 示例

我们可以简单地使用open命令并将目标部分留空。
这将使用基本 URL 并打开它。

于 2021-07-14T13:28:09.613 回答
0

在 de Selenium IDE的Base URL输入字段中指定的 URL 和在 open 命令的target参数中指定的 URL 不会简单地连接起来。打开/test/将被视为您域的绝对 URL。

但是,您可以指定一个 target ./test/,根据我的经验,它请求 requests http://test.info:50/test/test/。我发现这非常有用,因为在某些环境中,我的 Web 应用程序将驻留在根目录中,而在其他一些环境中的基本路径中,例如 /myapp/。

对于空白的基本 URL,我认为这是可行的,因为运行测试的浏览器页面已经显示了来自正确域的页面。如果您在任何其他站点的页面上执行 open 命令,则 open 命令会从该站点请求页面 /test/。之后,该基本 URL 将指向该站点。

于 2015-07-10T11:03:08.473 回答