devtools-proxy icon indicating copy to clipboard operation
devtools-proxy copied to clipboard

Unable to switch to iframe

Open UmarIqbal opened this issue 7 years ago • 3 comments

I am unable to switch context to iframe elements while using devtools-proxy. The same code works without using the proxy. Any ideas why this might be happening?

Sample code:

devtools_proxy_port = 9222
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument('--start-maximized')
chrome_options.add_argument('--ignore-certificate-errors')
chrome_options.add_argument('--disable-application-cache')
chrome_options.add_argument('--no-sandbox')
chrome_options.binary_location = CHROME_WRAPPER_PATH

chrome_options.add_argument('--chrome-binary=' + binary_location)
chrome_options.add_argument('--devtools-proxy-binary=devtools-proxy')
chrome_options.add_argument(f'--devtools-proxy-args=--port {devtools_proxy_port}')
driver = webdriver.Chrome(driver_path, chrome_options=chrome_options)

driver.set_page_load_timeout(page_load_timeout)


 try:
    driver.get('http://www.' + url_link)
    devtools_client.main_func(url_link)

    iframe_elements = driver.find_elements_by_tag_name('iframe')
    driver.switch_to.frame(iframe_elements[0])
    # Also tried with index, id but no luck
    # driver.switch_to.frame(0)
    # driver.switch_to.frame('iframe_id')
 except Exception as e:
    print('something went wrong.')

I am using Selenium 3.6, ChromeDriver 2.21, and Chromium. 48.

UmarIqbal avatar Apr 03 '18 20:04 UmarIqbal

Hey @UmarIqbal, thanks for the report, I'll have a look at it.

bayandin avatar Apr 04 '18 11:04 bayandin

@bayandin did you had a chance to look into it?

UmarIqbal avatar Apr 10 '18 00:04 UmarIqbal

@UmarIqbal I have reproduced this bug but currently, have no idea how to fix it, there is no clue in chromedriver logs. I'll take a closer look when will get some free time, probably it'll be in the next week. Sorry about that.

bayandin avatar Apr 13 '18 12:04 bayandin