class ServerUtils

Public Class Methods

new() click to toggle source

constructor

# File lib/TNR360/ServerUtils.rb, line 8
def initialize()
  @borwser=browser_create(:firefox)
end

Public Instance Methods

browser_create(version) click to toggle source
# File lib/TNR360/ServerUtils.rb, line 18
def browser_create(version)
  # :chrome, :ie, or :ff
  if(version==:firefox)
    profile = Selenium::WebDriver::Firefox::Profile.new
    profile.native_events = false
    #Watir::Browser.new WEB_DRIVER, :profile => profile
    @browser ||=  Watir::Browser.new version, :profile => profile
  else
    @browser ||= Watir::Browser.new(version)
  end

 #@browser.driver.manage.timeouts.implicit_wait=3
  @browser
end
connectToDemoServer() click to toggle source
# File lib/TNR360/ServerUtils.rb, line 12
def connectToDemoServer
  login( "http://ekipv7:9192/ekip360-gui-ws/Ekip.html", "ekip","ekip.360")
  @borwser
end
login(url,username, password) click to toggle source
# File lib/TNR360/ServerUtils.rb, line 37
def login(url,username, password)
  @browser.goto url
  @browser.driver.manage.window.maximize
  @browser.text_field(:name => "j_username").when_present.set(username)
  @browser.text_field(:name => "j_password").when_present.set(password )
  @browser.button(:value, "Connection").when_present.click
end