Calling different methods in a single file

I

Idealone Ideally

Hi All,
I was able to successfully create a class file login and login into my
application using ruby code.
I have created one more class file which selects drop down values in my
app.
I am not able to call both the class files at once, it says Method not
defined!!!
I wanted to know whether for each class file i need to initialize
Please let me know if any more information is required on this issue .
My code looks like this:

Class file 1:
require 'selenium'
class Zlogin
def initialize(userId,password)
@userId=userId
@password=password
puts 'intialize user and password'
end
def abc_login
selenium.set_speed "200"
selenium.open "/cvis"
selenium.type "userId",@userId
selenium.type "password",@password
selenium.click "//input[@value='Login']"
puts 'Login Sucess'
end
//Code
Similary Class file 2:
equire "selenium"
CODE//
class Price
puts " Now Price loading will start"
def Price(selenium)
puts "Start PRICE"
selenium.set_timeout "60000"
selenium.select "ddlbClientList", "label=CLIENT"
selenium.set_timeout "60000"
selenium.click "btnSubmit"
selenium.wait_for_page_to_load "500000"
selenium.click "link=Data"
//CODE

MAIN File calling class 1 & 2
CODE//
require "Zlogin"
require "Price "

z = Zlogin.new("admin","admin")
selenium=z.getSelenium
selenium.start
z.abc_login(selenium)

puts "Now Price Method to be called"
lp=Price .new
lp.Price(selenium)
//CODE

I am not able to call Class 2 file.....!! anything wrong in my code!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top