Why 'switch_to_frame' method doesn't work inside a 'within_frame' block?

Skip to first unread message

Osni Junior

Dec 7, 2021, 2:20:02 PM12/7/21
to Capybara
Hello everyone!!

I'm new of automation tests and all these world and i'm using cucumber/capybara and rspec.

I'm having a little problem with the use of the 'switch_to_frame' method because i want to use this inside a 'within_frame' block. When I execute my code, I received the following error:

"`switch_to_frame(:top)` cannot be called from inside a descendant frame's `within` block."

I've seen the documentation about 'switch_to_frame' and that's correct. It should be this.

But, I wanna understand why this is how it is.

For me, it seems just so simple use 'switch_to_frame' to change the iframe I'm using for the other iframe that I want to use you know.

Somebody can help explain this to me, PLEASE?

Reply all
Reply to author
0 new messages