#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2009
    Posts
    1
    Rep Power
    0

    Help with undefined methd text field for nil class


    undefined method `text_field' for nil:NilClass (NoMethodError)

    Hi i am getting the above error message when running this ruby script

    require 'watir' #use watir
    test_site='webmail.aol.com' #set variable
    ie = Watir::IE.new
    ie.goto(test_site) # go to set variable site
    $ie.text_field(:id,"lgnId1" ).set("asdasd")
    $ie.text field(:id,"pwdId").set("asdasd")
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jan 2004
    Location
    Constant Limbo
    Posts
    989
    Rep Power
    363
    In ruby, ie and $ie are distinct. Use one or the other (depending on your needs), but be consistent.

    Comments on this post

    • Arty Ziff agrees
    • medialint agrees
    True happiness is not getting what you want, it's wanting what you've already got.

    My Blog

IMN logo majestic logo threadwatch logo seochat tools logo