Roy,
I have only just joined this newsgroup but could have helped you with this earlier.

What I usually do is just:
self.marionette.switch_to_frame()   # to go to the top level frame
time.sleep(10) # to be 99.9% sure the app has loaded print self.marionette.page_source # to print the html of the top level frame

and then to a ctrl-f find in the console for the string "facebook" or the title of the app.

Crude, but it works.

I also published another blog post on frame switching last week.

Zac



On 05/03/2013 14:21, Roy Collings wrote:
SOLVED!!

GOT IT!!!!

I ended up writing a utility to switch through every iframe, take a screenshot, dump the html and 
report the "src" attribute ... the result is that you need to switch to the iframe who 
has the attribute 'src' = "".

This is not the same iframe as "self.marionette.switch_to_frame()".

So I now use this to see the facebook iframe:

    self.connect_to_iframe("")

     def connect_to_iframe(self, p_name):
         iframes = self.marionette.execute_script("return 
document.getElementsByTagName('iframe')")
         for idx in range(0,iframes['length']):
             iframe = iframes[str(idx)]
             if p_name == iframe.get_attribute('src'):
                 self.marionette.switch_to_frame(iframe)
                 return True
         return False

If that information about this iframe was available somewhere, it would've 
saved me about 7 hours of investigations.
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to