Issue Details (XML | Word | Printable)

Key: SRC-387
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jason Huggins
Reporter: Jens Berger
Votes: 4
Watchers: 6
Operations

If you were logged in you would be able to see more operations.
Selenium Remote Control

baseUrl is wrong when calling selenium-server with parameter -htmlSuite

Created: 14/Nov/07 08:29 AM   Updated: 11/Mar/09 06:57 PM   Resolved: 11/Mar/09 06:57 PM
Component/s: Server
Affects Version/s: 0.9.2
Fix Version/s: 1.0

File Attachments: 1. Text File SRC-387-HtmlSuite_BaseUrl.patch (2 kB) 05/Dec/08 01:04 AM - Donald

Environment: WinXP, Java 1.6.0_02-b06


 Description  « Hide

When calling selenium-server like this:

java -jar selenium-server.jar -htmlSuite *firefox http://localhost:8080 "M:\Master\STC.html" "M:\results.html",

the given baseUrl is not used directly but "/selenium-server/tests" is added automatically. So a test that should, for example, open "index.html" (relative path!) fails with error 404 because the browser tries to open the URL "http://localhost:8080/selenium-server/tests/index.html", which does not exist.
(/index.html works because of the leading slash; but then we have a number of test suites that use relative URLs and they work in Selenium IDE.)

When I manually "correct" the baseUrl parameter in the browser window and open that URL, everything works as expected.

The <selenese ...> ant task shows the same problem.



Sort Order: Ascending order - Click to sort in descending order
Antoine added a comment - 24/Nov/07 10:34 PM

Same problem on my linux server Java(TM) SE Runtime Environment (build 1.6.0_03-b05) with selenium serveur 0.9.2


Donald added a comment - 04/Dec/08 09:49 PM

I have been able to recreate this issue using the htmlSuite
This issue only occurs in the html Runner. Clients and Interactive do not show the behaviour.

java -jar selenium-server.jar -htmlSuite *firefox http://localhost:8080 "M:\Master\STC.html" "M:\results.html"

"open <blank>" eg relative will fail giving
http://localhost:8080//selenium-server/tests/

"open /absolute/" will pass giving
http://localhost:8080/absolute/

"open relative/" will fail giving
http://localhost:8080//selenium-server/tests/relative/

I have checked with the
latest nightlies, beta1, 0.9.2, 0.9.0
Fox 2,3; IE; Opera

They all exhibit the same behaviour on a localhost and web address.

This may be related to bug:
http://jira.seleniumhq.org/browse/SRC-329

I have been looking through the java files and everything appears fine up to ln 143 of HTMLLauncher.java where in the latest nightlies the line
if (browser.startsWith("*chrome") || browser.startsWith("*iehta") ) {
needs to change to:
if (browser.startsWith("*chrome") || browser.startsWith("*iehta") || browser.startsWith("*firefox")) {
as the chrome launcher is actually used for firefox which requires the updated url; but this is best off in another bug I guess. From there It appears ok up to launching the browser. I am currently working from there. Any ideas, areas to focus on?

XP sp2
RC - latest nightlies, beta1, 0.9.2, 0.9.0
FF 2,3; IE; Opera

Donald


Donald added a comment - 05/Dec/08 01:04 AM

Patch for SRC-387

browserlaunchers/LauncherUtils.java
-removed selenium-server/tests/ as it is not required in the tested browsers, IE, ffox3, opera, removing fixes the issue in Jira SRC-387

htmlrunner/HTMLLauncher.java
-firefox and iexplore are now using chrome and iehta respectively by default; therefore need the updated suiteUrl

Donald


Jason Huggins added a comment - 13/Jan/09 04:25 AM

I got bit by this issue, too. I've tested Donald's patch, and it works for me... Ran a clean build and all tests pass. I'll run this in production against "real" customer tests for a bit, and if it's still good, I'll check it in. Thanks, Donald for the patch, and Jens for reporting the issue!


Parag P. Doke added a comment - 16/Jan/09 02:47 AM

Hello Everyone.
Just happened to run into the baseUrl issue today.
However, there is a small difference in my case.
The AUT has different contexts defined after the port. Would this too work after making the changes mentioned here ?

http://host:port/context1/
http://host:port/context2/

I was trying to run the selenium-server like this [using a Windows batch file]:
%JAVA_HOME%\bin\java -jar "%~dp0selenium-server.jar" -htmlsuite "*iexplore" "http://host:port/context1/" "%~dp0TestSuite.html" "%~dp0Results.html"

In each of the tests referenced by the test suite, I was trying to have the first step as [Selenium IDE html format]:
<tr>
<td>open</td>
<td>/index.html</td>
<td></td>
</tr>

I am not familiar with Java. But I will try my best to download the code, the patch and build the jar file.


Corey Gerritsen added a comment - 19/Feb/09 08:45 PM

Donald's patch worked for me as well +++
Why isn't this in the trunk yet?


Jason Huggins added a comment - 11/Mar/09 06:57 PM

I applied this patch in subversion revision 2632. It will ship with Selenium 1.0 Final. Thanks for the patch, Donald.