Accessing elements inside iframe

4,820 views
Skip to first unread message

Stas Sl

unread,
Jun 28, 2017, 3:26:42 AM6/28/17
to Google Chrome Developer Tools
Hi, how can I access elements inside an iframe? For example to click on them or call DOM.querySelector. Is it possible to select 'active' frame? Like in Nightwatch.js/Selenium you can call browser.frame(frameIndex)

Kayce Basques

unread,
Jun 28, 2017, 5:09:03 PM6/28/17
to Google Chrome Developer Tools
You can just right-click on the element and select Inspect and DevTools highlights it in the DOM Tree on the Elements panel.

In the Console, use the Execution Context Menu to change the context of the Console to the iframe. 

Stas Sl

unread,
Jun 29, 2017, 7:23:16 AM6/29/17
to Google Chrome Developer Tools
Thanks, Kayce. I should clarify that I need to access them programmatically via Chrome DevTools Protocol.
Reply all
Reply to author
Forward
0 new messages