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!!
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!!