First, as @apanizo said, you'll want to use a LoadHandler
to make sure the document is loaded in the frame.
Then, to read into the frame's document, you'll have to use IFrameElement.as(frame.getElement())
or frame.getElement().<IFrameElement>cast()
and then use getContentDocument()
.
IFrameElement.as(frame.getElement()).getContentDocument().getElementsByTagName("table").getLength()
A final note: this won't work if the document loaded in the frame is not from the same origin as your GWT app.