Rubymine, Selenium, iFrame

31 views
Skip to first unread message

robert.m...@jove.com

unread,
Oct 11, 2017, 12:02:51 AM10/11/17
to Selenium Users
Hello,

Fair warning: I'm a beginner at Ruby and am taking on my first browser automation project with Selenium and Rubymine on Windows 10.  To log into my website of choice, I believe I need to switch_To an iFrame where I can enter username and password, but I receive an error when I try to do so. See below for code and error message:

Relevant line of code:
driver.switch_To.frame driver.find_element(id: "content")

relevant error:
in `<top (required)>': undefined method `switch_To' for #<Selenium::WebDriver::Chrome::Driver:0x0000000003c903a8> (NoMethodError)
from -e:1:in `load'
from -e:1:in `<main>'

Any suggestions on what to do?

Shawn McCarthy

unread,
Oct 11, 2017, 12:19:05 AM10/11/17
to Selenium Users
I think "To" should be "to". Like here http://elementalselenium.com/tips/3-work-with-frames
  @driver.switch_to.frame('frame-top')

Reply all
Reply to author
Forward
0 new messages