Locating the right frame
The first problem is that you are looking in the wrong frame. There are actually 4 frames on the page (assuming you have clicked the Sign In link).
To avoid locating the element by index, you should also consider the attributes of elements around iframe:
<div class="_modal_content close-this-modal" id="_modal_content" tabindex="998">
<div class="modal modal-iframe" tabindex="1000">
<h1></h1>
<div style="height: 638px;" class="modal-iframe-wrapper">
<iframe marginheight="0" marginwidth="0" src="removed.html" frameborder="0" height="auto">
As you can seen in this html, the frame is the first frame in the "_modal_content" div tag. Therefore, you can find the frame with:
fr = b.div(:id => '_modal_content').frame
Getting text of a frame
The second problem is that the text
method returns a blank string for frame elements. I do not remember if it has always been like this, but it seems that you need to check the text of a specific element in the frame (rather than the frame itself). The easiest way to do this is to get the first element, which is the html element.
fr.element.text.include? 'Remember My Sign-In ID'
#=> true