Module: BrowserHelper

Defined in:
lib/watir_helper/browser_helper.rb

Instance Method Summary collapse

Instance Method Details

#attach_an_IE_window(property, propertyvalue) ⇒ Object

Attach an IE instance.



42
43
44
45
# File 'lib/watir_helper/browser_helper.rb', line 42

def attach_an_IE_window(property,propertyvalue)
  propertyvalue=/#{propertyvalue}/
  $ie=Watir::IE.attach(property.intern,propertyvalue)
end

#close_browserObject

Close the browser.



26
27
28
29
# File 'lib/watir_helper/browser_helper.rb', line 26

def close_browser()
  title=get_title()
 $ai.WinKill(title)
end

#get_titleObject

Get the title of the browser.



32
33
34
# File 'lib/watir_helper/browser_helper.rb', line 32

def get_title()
  $ie.title
end

#get_urlObject

Get the url of the browser.



37
38
39
# File 'lib/watir_helper/browser_helper.rb', line 37

def get_url()
  $ie.url
end

#goto_next_pageObject

Go to the next page.



11
12
13
# File 'lib/watir_helper/browser_helper.rb', line 11

def goto_next_page()
 $ie.forward
end

#goto_page(url) ⇒ Object

Go to a page.



6
7
8
# File 'lib/watir_helper/browser_helper.rb', line 6

def goto_page(url)
 $ie.goto(url)
end

#goto_previous_pageObject

Go to the previous page.



16
17
18
# File 'lib/watir_helper/browser_helper.rb', line 16

def goto_previous_page()
 $ie.back
end

#maximize_browserObject

Maximize the browser.



53
54
55
# File 'lib/watir_helper/browser_helper.rb', line 53

def maximize_browser()
  $ie.maximize
end

#minimize_browserObject

Minimize the browser.



48
49
50
# File 'lib/watir_helper/browser_helper.rb', line 48

def minimize_browser()
  $ie.minimize
end

#refresh_the_pageObject

Refresh the page.



21
22
23
# File 'lib/watir_helper/browser_helper.rb', line 21

def refresh_the_page()
  $ie.refresh
end

#verify_text(text) ⇒ Object

Verify whether text is present or not.



58
59
60
# File 'lib/watir_helper/browser_helper.rb', line 58

def verify_text(text)
  $ie.text.include?(text)
end