I’ve got a chunk of text in an iframe and I’d like to assert that the text is correct. However, it always fails, even after selecting the iframe.
<iframe>
...
<tbody>
<tr class="sub">
<td width="100%" class="bodyText">Your username has been sent to: f*****@example.net</td>
</tr>
<tr class="row">
<td> </td>
</tr>
</tbody>
</iframe>
The selenium script looks like:
<tr>
<td>selectFrame</td>
<td>index=0</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>has been sent</td>
<td></td>
</tr>
Select frame always passes. There is only one frame on the page. AssertTextPresent always fails. I’ve read a related bug report on the Selenium JIRA — from 2 years ago with no responses. Looked around on the web a bit and the suggestion is to select the frame then assert, which is what I’m doing. Stumped.
What should I do to check for text that is in an iframe?
Got the answer 2 minutes later. I forgot that sometimes with selenium IDE you use the Target field and sometimes you use the Value field. In this case, putting
has been sentinto the value field did the trick.