Re: How to get URL of the page opened in the current frame?

Some history :)

We never used to have executeScript, and there are some implementations
where relying on JS execution can't be done (notably some of the simulated
browsers, such as the HtmlUnitDriver in the Selenium project).

The original reasoning behind returning the top-level browsing context was
to allow testers to do something like:

driver.get("http://example.com");
driver.switchTo().frame("id");
// Do some stuff
// Simulate a reload by grabbing the current URL and navigating there
driver.get(driver.getCurrentUrl());

That allowed testing of something that makes extensive use of frames a
simpler proposition.

Given that a user could, in theory, find the current context's URL using
JS, I think:

a) We should keep the end point
b) We should keep the existing semantics (where we return the url of the
top-level browsing context)

Simon

On Mon, Sep 7, 2015 at 4:36 PM, Alexei Barantsev <barancev@gmail.com> wrote:

> The "execute script" argument can be applied to this operation in general.
>
> I'll better vote +1 to remove it from the specification than to change the
> semantics.
>
> Regards,
> --
> Alexei Barantsev, Software-Testing.Ru
> mailto: barancev@gmail.com
> phone: +7 (916) 726-95-55
> skype : barancev
>
> 2015-09-07 18:24 GMT+03:00 David Burns <dburns@mozilla.com>:
>
>> So the behaviour of Selenium seems very bizarre, to get this info you
>> could easily do this via an execute script. If we move to the selenium way
>> I am more inclined to remove it from the specification.
>>
>> Why would we want to keep it, other than "that's the way it's always
>> been".
>>
>> David
>>
>> On 7 September 2015 at 13:51, Andreas Tolfsen <ato@mozilla.com> wrote:
>>
>>> On Sun, Sep 6, 2015 at 3:40 PM, Alexei Barantsev <barancev@gmail.com>
>>> wrote:
>>> > What is the reasoning behind this change?
>>>
>>> This is an overlook, I’ve submitted PR
>>> https://github.com/w3c/webdriver/pull/247 to rectify this.
>>>
>>>
>>
>

Received on Monday, 7 September 2015 19:37:41 UTC