Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capybara How to use within_frame for the only iframe in the page without id

I have an in the the page that I need to test with Cucumber and Capybara, the iframe does not have a class or id attribute but it's the only iframe on the DOM. How can I use the within_frame capybara method?

like image 828
juliangonzalez Avatar asked Oct 28 '25 14:10

juliangonzalez


1 Answers

If you're using a recent version of Capybara the locator argument to within_frame is optional if there's only one iframe on the page

within_frame do
  # blah blah
end
like image 142
Thomas Walpole Avatar answered Oct 30 '25 06:10

Thomas Walpole