Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8746275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:10:09+00:00 2026-06-13T12:10:09+00:00

Hello I am new to programming working on Selenium using Ruby and I’m having

  • 0

Hello I am new to programming working on Selenium using Ruby and I’m having some trouble. I am trying to call a method from a class in another module so I can create a sort of method library and every time I am returned the error NoMethodError: undefined method 'find_element' for Selenium::WebDriver:Module I have require_relative “LeadForm” to require the other module and the code works properly when I put the method directly into the class I’m using it in but I would really like to just have it written once because this is something I will be using a lot.

The code is

def self.progCNA

Selenium::WebDriver::Support::Select.new(@driver.find_element(:name,
“area_of_study”)).select_by(:text, “Health & Medical / Nursing”)
Selenium::WebDriver::Support::Select.new(@driver.find_element(:name,
“concentration”)).select_by(:text, “Nursing Assistant (CNA)”)

end

and when I call it in the the class that runs the test I put

LeadForm.progCNA

and it appears to recognize and run the method but then the method errors out.

Any help would be greatly appreciated as this has been a source of a lot of frustration and I can’t for the life of me find a solution online. I have looked up, down and sideways. If you require any more information from me please let me know and I will get it to you as soon as possible! Thank you very much.

I’m using
Windows 7 Pro sp1
JetBrains RubyMine 4.5.3
Ruby 1.9.3
selenium-webdriver 2.25.0

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:10:10+00:00Added an answer on June 13, 2026 at 12:10 pm

    If I understand the situation, I think you have a variable scope issue.

    If you want to keep your class structure the way it is, I would update your method with…

    def self.progCNA(driver)

    Selenium::WebDriver::Support::Select.new(driver.find_element(:name,
    “area_of_study”)).select_by(:text, “Health & Medical / Nursing”)
    Selenium::WebDriver::Support::Select.new(driver.find_element(:name,
    “concentration”)).select_by(:text, “Nursing Assistant (CNA)”)

    end

    … and call it with

    LeadForm.progCNA(@driver)

    You could… make a $driver global instead…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello I'm new to PHP programming and I migrated from ASP .net to PHP..
Hello I am new at Haskell and i'm having problems trying to get this
Hello I'm trying to improve my ruby knowledge by reading The Ruby Programming Language
I'm new at kernel programming and trying to do a Hello World example. I
Hello im new to programming, im trying to construct my first simple application, im
I am new to the android programming and my working environment is eclipse helio
Hello I'm new to ontologies, my assignment is to create an ontology using Protege
Hello I am new here and programming in C. I didn't want to ask
I am new to C programming and I am having problems understanding common pitfalls
Hello I'm trying to run a simple sql command on a DB from MS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.