Class: ServerUtils

Inherits:
Object
  • Object
show all
Defined in:
lib/TNR360/ServerUtils.rb

Instance Method Summary collapse

Constructor Details

#initializeServerUtils

constructor



8
9
10
# File 'lib/TNR360/ServerUtils.rb', line 8

def initialize()
  @borwser=browser_create(:firefox)
end

Instance Method Details

#browser_create(version) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# 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

#connectToDemoServerObject



12
13
14
15
# File 'lib/TNR360/ServerUtils.rb', line 12

def connectToDemoServer
  ( "http://ekipv7:9192/ekip360-gui-ws/Ekip.html", "ekip","ekip.360")
  @borwser
end

#login(url, username, password) ⇒ Object



37
38
39
40
41
42
43
# File 'lib/TNR360/ServerUtils.rb', line 37

def (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