Frames - Selenium in ruby

Selenium ruby supports 3 ways allowing us to identify the frames.
  • Name
  • Index
  • Standard identification methods
For example – If you want to switch to the frame with name – bios, you can use below code.
 
driver.switch_to.frame “bios”

To switch to the first frame in the page, use below code.
 
driver.switch_to.frame 1

You can also switch to the frame if you know its xpath, css selectors, class name etc.
 
driver.switch_to.frame driver.find_element(:id, ‘outer’)

Complex problems, Simple Solutions