History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SEL-329
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Haw-Bin Chai
Reporter: Micah Stetson
Votes: 2
Watchers: 2
Operations

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

storeLocation stores a reference, not a value

Created: 29/Sep/06 02:05 PM   Updated: 03/Mar/08 07:33 PM
Component/s: None
Affects Version/s: 0.8.0
Fix Version/s: 1.0

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: Any


 Description  « Hide
Given a test like this:

...
<tr><td>open</td><td>/page1.html</td><td></td></tr>
<tr><td>storeLocation</td><td>loc</td><td></td></tr>
<tr><td>open</td><td>/page2.html</td><td></td></tr>
<tr><td>type</td><td>//input[@type="text"]</td><td>${loc}</td></tr>
...

The input field will be filled in with the URL of page2.html rather than page1 as expected. Here is a patch:

diff selenium-api.js.orig selenium-api.js
900c900
< return this.page().getCurrentWindow().location;
---
> return this.page().getCurrentWindow().location.href;


 All   Comments   Work Log   Change History      Sort Order:
Chris Wesseling - 28/Jan/08 12:21 PM
What is needed to get this patch in the mainstream release?

For those waiting for this patch to be incorporated:
You can fix this in your user-extensions.js by overwriting the Selenium.prototype.getLocation

Selenium.prototype.getLocation = function() {
    /** Gets the absolute URL of the current page.
   *
   * @return string the absolute URL of the current page
   */
    return this.browserbot.getCurrentWindow().location.href;
};

Haw-Bin Chai - 03/Mar/08 07:33 PM
Added the simple change.