{"action":"created","issue":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/548","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/548/labels{/name}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/548/comments","events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/548/events","html_url":"https://github.com/webdriverio/webdriverio/issues/548","id":82535331,"number":548,"title":"Switching to an iframe inside an iframe","user":{"login":"arunshan","id":1124102,"avatar_url":"https://avatars.githubusercontent.com/u/1124102?v=3","gravatar_id":"","url":"https://api.github.com/users/arunshan","html_url":"https://github.com/arunshan","followers_url":"https://api.github.com/users/arunshan/followers","following_url":"https://api.github.com/users/arunshan/following{/other_user}","gists_url":"https://api.github.com/users/arunshan/gists{/gist_id}","starred_url":"https://api.github.com/users/arunshan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arunshan/subscriptions","organizations_url":"https://api.github.com/users/arunshan/orgs","repos_url":"https://api.github.com/users/arunshan/repos","events_url":"https://api.github.com/users/arunshan/events{/privacy}","received_events_url":"https://api.github.com/users/arunshan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/webdriverio/webdriverio/labels/Needs%20Investigation","name":"Needs Investigation","color":"bfdadc"},{"url":"https://api.github.com/repos/webdriverio/webdriverio/labels/Selenium%20Related","name":"Selenium Related","color":"ffffff"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-05-29T18:29:26Z","updated_at":"2015-07-19T20:33:57Z","closed_at":"2015-07-19T20:33:57Z","body":"Unable to switch to an iframe inside an iframe.\r\nThe VAST_URL is generated from our server to test on google VAST inspector.\r\n\r\n```js\r\nlet GOOGLE_VAST_INSPECTOR = 'https://google-developers.appspot.com/interactive-media-ads/docs/sdks/html5/vastinspector_d53684b3fa6d027ab4456dfcd1324520.frame?hl=en&redesign=true';\r\nconst PAGE_LOAD_TIMEOUT = 100000;\r\nlet RELEASE_ID;\r\nlet VAST_URL = 'https://example-experience-staging.herokuapp.com/'+RELEASE_ID+'/vast.xml';\r\n\r\nclient\r\n.url(GOOGLE_VAST_INSPECTOR)\r\n.timeouts('page load', PAGE_LOAD_TIMEOUT)\r\n.leftClick('#player-control-switch')\r\n.setValue('#vast-tag-url', VAST_URL)\r\n.leftClick('#test-ad-button')\r\n.element('iframe', function(err, res) {\r\n  client\r\n  .frame(res.value)\r\n  .element('iframe', function (err, res) {\r\n    console.log( \"the frame 2 is \" , res);\r\n      client\r\n        .frame(res.value)\r\n  });\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/webdriverio/webdriverio/issues/comments/122702053","html_url":"https://github.com/webdriverio/webdriverio/issues/548#issuecomment-122702053","issue_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/548","id":122702053,"user":{"login":"christian-bromann","id":731337,"avatar_url":"https://avatars.githubusercontent.com/u/731337?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-bromann","html_url":"https://github.com/christian-bromann","followers_url":"https://api.github.com/users/christian-bromann/followers","following_url":"https://api.github.com/users/christian-bromann/following{/other_user}","gists_url":"https://api.github.com/users/christian-bromann/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-bromann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-bromann/subscriptions","organizations_url":"https://api.github.com/users/christian-bromann/orgs","repos_url":"https://api.github.com/users/christian-bromann/repos","events_url":"https://api.github.com/users/christian-bromann/events{/privacy}","received_events_url":"https://api.github.com/users/christian-bromann/received_events","type":"User","site_admin":false},"created_at":"2015-07-19T20:33:57Z","updated_at":"2015-07-19T20:33:57Z","body":"Sorry for the delay. I've checked it and it seems to be possible. Here is an example:\r\n\r\n```js\r\nvar client = require('webdriverio').remote({\r\n    desiredCapabilities: {\r\n        browserName: 'phantomjs'\r\n    }\r\n});\r\n\r\nclient\r\n    .init()\r\n    .url('http://webdriverjs.christian-bromann.com/three.html')\r\n    .getHTML('head title', false).then(console.log)\r\n    .element('iframe').then(function(res) {\r\n      return client.frame(res.value).getHTML('head title', false);\r\n    }).then(function(title) {\r\n      console.log(title);\r\n      return client.element('iframe');\r\n    }).then(function(res) {\r\n      return client.frame(res.value);\r\n    })\r\n    .getHTML('head title', false).then(console.log)\r\n    .end();\r\n```"}}