Use selenium commands inside an IFRAME
In a business environment requires a B2B relationship , witch means our project will be integrated with other projects from a different company , for example imagine an id verification form , your company runs a gambling business and they need that functionality , so there are third party on the market that provides it , that means you guys are going to take their form wrap it up in an iframe and use it , so how to handle iframe in selenium.
page.driver.within_frame('iframe') do fill_in 'E-mail', with: 'firstname.lastname@example.org' fill_in 'Password', with: '***********' click_button 'Submit' end
For more details about within_frame you can check capybara documentation .
How to handle iframe in WebDriver
In Webdriver, you should use
driver.switchTo(). to get inside an iframe.
Keep in mind that webdriver will not know how to switch back to your website from the iframe , you need to tell it :
This was java syntax but is pretty much the same in any other languages.