in_frame method

40 views
Skip to first unread message

Ian H (RubyGemTSL)

unread,
Apr 26, 2013, 10:23:32 AM4/26/13
to page-...@googlegroups.com

Hi Cheezy, I posted this on a thread but it's really old so I thought I'd post here.

As long as I use the in_frame method I should get access to all elements on my page, right?

I am having a lot of trouble with this, I have a full page that is wrapped by an iFrame, its such a pain to test.

I seem to be able to get the content (i.e. text) and click elements within the frame but I cannot get hold of elements to assert that they are present.

For example in my object I have:

in_frame(:id => ‘master’) do |frame|
button(:apply_now_button, :id => ‘apply_now_button’, :frame => frame)
end

def apply_now_element
apply_now_button_element
end

And in my step definition I would like to assert that this apply_now_button_element is present is present or visible. However when I do, I get the following error:
Element belongs to a different frame than the current one – switch to its containing frame to use it (Selenium::WebDriver::Error::StaleElementReferenceError)

Any ideas?

-Thanks

Reply all
Reply to author
Forward
0 new messages