class Magnesium::Browser

Attributes

browser[RW]

attr_accessor :box

Public Class Methods

new(type) click to toggle source
# File lib/magnesium/elements/browser.rb, line 9
def initialize(type)
  if type == "chrome"
    @browser = Watir::Browser.new :chrome
  elsif type == "ie"
    @browser = Watir::Browser.new :ie
  elsif type == "firefox"
    @browser = Watir::Browser.new
  else
    nonfun
  end
end

Public Instance Methods

close() click to toggle source
# File lib/magnesium/elements/browser.rb, line 25
def close()
  @browser.close
end
goto(url) click to toggle source
# File lib/magnesium/elements/browser.rb, line 21
def goto(url)
  @browser.goto url.to_s
end