I'm new to Ruby on Rails and I was working on a catalog website which consists of two frames: the first one contains product families and the second one dynamically shows the list of machines within those families as you click them on the first frame. This happens since form target is that frame's name:
I have already inspected this answer but there is an important difference: I want to iteratively click through the product family links in the first frame by working "within_frame('families_frame')" and get the list of machines in the second frame. However "switch_to_frame" and similar solutions do not work and I get the following error:
switch_to_window
is not supposed to be invoked from within
's, within_frame
's' or within_window
's' block. (Capybara::ScopeError)
Because my iterator runs from "within_frame". How can I switch to the resulting frame, reach the content and then switch back to the working frame? The HTML structure is:
<HTML>
<FRAME NAME="families_frame" SRC=".../productfamily.jsp">
<FRAME NAME="machines_frame" SRC=".../blank.jsp">
</HTML>
Thank you a lot.