Selenium: getCurrentURL of current frame not return the URL of the frame

Created on 2 Mar 2016  路  1Comment  路  Source: SeleniumHQ/selenium

Expected Behavior -

Until recent releases of chromedriver it was possible to get the current URL of selected frame

Actual Behavior -

At the moment the method there is no way to getCurrentURL of the frame but only on the main window.

Steps to reproduce -

  1. Go to URL with some iframe
  2. Select the iframe
  3. Use method like:
    currentUrl() {
    return browser.driver.getCurrentUrl();
    }
    to get current URL

Most helpful comment

This is expected behaviour. If you require that frames url use executeScript('return document.location.href');

>All comments

This is expected behaviour. If you require that frames url use executeScript('return document.location.href');

Was this page helpful?
0 / 5 - 0 ratings