Class: ServerUtils
- Inherits:
-
Object
- Object
- ServerUtils
- Defined in:
- lib/TNR360/ServerUtils.rb
Instance Method Summary collapse
- #browser_create(version) ⇒ Object
- #connectToDemoServer ⇒ Object
-
#initialize ⇒ ServerUtils
constructor
constructor.
- #login(url, username, password) ⇒ Object
Constructor Details
#initialize ⇒ ServerUtils
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 |
#connectToDemoServer ⇒ Object
12 13 14 15 |
# 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) ⇒ Object
37 38 39 40 41 42 43 |
# 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.(:value, "Connection").when_present.click end |