Module: BrowserHelper
- Defined in:
- lib/watir_helper/browser_helper.rb
Instance Method Summary collapse
-
#attach_an_IE_window(property, propertyvalue) ⇒ Object
Attach an IE instance.
-
#close_browser ⇒ Object
Close the browser.
-
#get_title ⇒ Object
Get the title of the browser.
-
#get_url ⇒ Object
Get the url of the browser.
-
#goto_next_page ⇒ Object
Go to the next page.
-
#goto_page(url) ⇒ Object
Go to a page.
-
#goto_previous_page ⇒ Object
Go to the previous page.
-
#maximize_browser ⇒ Object
Maximize the browser.
-
#minimize_browser ⇒ Object
Minimize the browser.
-
#refresh_the_page ⇒ Object
Refresh the page.
-
#verify_text(text) ⇒ Object
Verify whether text is present or not.
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_browser ⇒ Object
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_title ⇒ Object
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_url ⇒ Object
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_page ⇒ Object
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_page ⇒ Object
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_browser ⇒ Object
Maximize the browser.
53 54 55 |
# File 'lib/watir_helper/browser_helper.rb', line 53 def maximize_browser() $ie.maximize end |
#minimize_browser ⇒ Object
Minimize the browser.
48 49 50 |
# File 'lib/watir_helper/browser_helper.rb', line 48 def minimize_browser() $ie.minimize end |
#refresh_the_page ⇒ Object
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 |