@throws Exception if something goes wrong
()
| 131 | * @throws Exception if something goes wrong |
| 132 | */ |
| 133 | @Test |
| 134 | public void iFrame() throws Exception { |
| 135 | final String html = DOCTYPE_HTML |
| 136 | + "<html>\n" |
| 137 | + "<head><title>foo</title></head>\n" |
| 138 | + "<body>\n" |
| 139 | + " <iframe id='tester' src='second.html'></iframe>\n" |
| 140 | + "</body></html>"; |
| 141 | |
| 142 | final String html2 = DOCTYPE_HTML |
| 143 | + "<html>\n" |
| 144 | + "<head><title>frame</title></head>\n" |
| 145 | + "<body>\n" |
| 146 | + "</body></html>"; |
| 147 | |
| 148 | try (WebClient webClient = new WebClient(getBrowserVersion(), false, null, -1)) { |
| 149 | final MockWebConnection webConnection = getMockWebConnection(); |
| 150 | webConnection.setResponse(URL_FIRST, html); |
| 151 | webConnection.setDefaultResponse(html2); |
| 152 | webClient.setWebConnection(webConnection); |
| 153 | |
| 154 | final HtmlPage page = webClient.getPage(URL_FIRST); |
| 155 | |
| 156 | final HtmlInlineFrame iFrame = (HtmlInlineFrame) page.getElementById("tester"); |
| 157 | assertEquals("frame", ((HtmlPage) iFrame.getEnclosedWindow().getEnclosedPage()).getTitleText()); |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * @throws Exception if something goes wrong |
nothing calls this directly
no test coverage detected