watir 1.5.4 → 1.5.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/bin/watir-console +1 -0
  2. data/changes.rb +16 -2
  3. data/readme.rb +2 -16
  4. data/unittests/buttons_test.rb +74 -101
  5. data/unittests/buttons_xpath_test.rb +3 -3
  6. data/unittests/checkbox_test.rb +3 -3
  7. data/unittests/checkbox_xpath_test.rb +3 -3
  8. data/unittests/core_tests.rb +1 -1
  9. data/unittests/css_test.rb +2 -7
  10. data/unittests/defer_test.rb +2 -2
  11. data/unittests/dialog_test.rb +2 -2
  12. data/unittests/div2_xpath_test.rb +1 -1
  13. data/unittests/div_test.rb +122 -121
  14. data/unittests/div_xpath_test.rb +3 -3
  15. data/unittests/errorchecker_test.rb +3 -8
  16. data/unittests/filefield_test.rb +4 -7
  17. data/unittests/filefield_xpath_test.rb +3 -5
  18. data/unittests/form_test.rb +7 -7
  19. data/unittests/form_xpath_test.rb +6 -6
  20. data/unittests/frame_test.rb +8 -9
  21. data/unittests/google_form_test.rb +1 -2
  22. data/unittests/html/div.html +7 -1
  23. data/unittests/html/lists.html +1 -1
  24. data/unittests/ie_mock.rb +4 -2
  25. data/unittests/ie_test.rb +2 -2
  26. data/unittests/images_test.rb +2 -2
  27. data/unittests/images_xpath_test.rb +2 -2
  28. data/unittests/links_multi_test.rb +23 -9
  29. data/unittests/links_test.rb +7 -7
  30. data/unittests/links_xpath_test.rb +2 -3
  31. data/unittests/lists_test.rb +6 -3
  32. data/unittests/map_test.rb +1 -2
  33. data/unittests/minmax_test.rb +4 -5
  34. data/unittests/navigate_test.rb +18 -23
  35. data/unittests/nbsp_xpath_test.rb +4 -5
  36. data/unittests/{screen_capture_test.rb → other/screen_capture_test.rb} +1 -1
  37. data/unittests/pagecontainstext_test.rb +3 -4
  38. data/unittests/parent_child_test.rb +1 -1
  39. data/unittests/pre_test.rb +2 -3
  40. data/unittests/radios_test.rb +13 -17
  41. data/unittests/radios_xpath_test.rb +3 -3
  42. data/unittests/selectbox_test.rb +6 -14
  43. data/unittests/selectbox_xpath_test.rb +3 -3
  44. data/unittests/setup.rb +30 -10
  45. data/unittests/speed_settings_test.rb +2 -3
  46. data/unittests/table_cell_using_xpath_test.rb +2 -7
  47. data/unittests/table_test.rb +144 -136
  48. data/unittests/table_xpath_test.rb +5 -9
  49. data/unittests/textarea_test.rb +3 -7
  50. data/unittests/textarea_xpath_test.rb +5 -9
  51. data/unittests/textfield_for_ch_char_test.rb +1 -1
  52. data/unittests/textfields_test.rb +3 -4
  53. data/unittests/textfields_xpath_test.rb +3 -3
  54. data/unittests/windows/attach_to_existing_window_test.rb +2 -2
  55. data/unittests/windows/attach_to_new_window_test.rb +2 -2
  56. data/unittests/windows/close_window_test.rb +2 -3
  57. data/unittests/windows/frame_links_test.rb +1 -1
  58. data/unittests/windows/iedialog_test.rb +3 -3
  59. data/unittests/windows/js_events_test.rb +2 -4
  60. data/unittests/windows/modal_dialog_test.rb +2 -2
  61. data/unittests/windows/send_keys_test.rb +2 -4
  62. data/watir.rb +4 -13
  63. data/watir/assertions.rb +9 -1
  64. data/watir/collections.rb +6 -11
  65. data/watir/container.rb +9 -99
  66. data/watir/cookiemanager.rb +4 -1
  67. data/watir/element.rb +8 -1
  68. data/watir/ie.rb +2 -2
  69. data/watir/input_elements.rb +2 -2
  70. data/watir/non_control_elements.rb +39 -2
  71. data/watir/page-container.rb +1 -1
  72. data/watir/table.rb +25 -23
  73. metadata +68 -54
  74. data/watir/bonus-elements.rb +0 -65
  75. data/watir/testUnitAddons.rb +0 -8
@@ -1,18 +1,14 @@
1
1
  # feature tests for Tables
2
- # revision: $Revision: 962 $
2
+ # revision: $Revision: 1348 $
3
3
 
4
4
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
5
5
  require 'unittests/setup'
6
6
 
7
7
  class TC_Tables_XPath < Test::Unit::TestCase
8
- include Watir
8
+ include Watir::Exception
9
9
 
10
10
  def setup
11
- gotoTablePage
12
- end
13
-
14
- def gotoTablePage
15
- $ie.goto($htmlRoot + "table1.html")
11
+ goto_page "table1.html"
16
12
  end
17
13
 
18
14
  def test_Table_Exists
@@ -48,10 +44,10 @@ class TC_Tables_XPath < Test::Unit::TestCase
48
44
  end
49
45
 
50
46
  def test_table_from_element
51
- $ie.goto($htmlRoot + "simple_table_buttons.html")
47
+ goto_page "simple_table_buttons.html"
52
48
 
53
49
  button = $ie.button(:xpath , "//input[@id='b1']/")
54
- table = Table.create_from_element($ie,button)
50
+ table = Watir::Table.create_from_element($ie,button)
55
51
 
56
52
  table[2][1].button(:index,1).click
57
53
  assert($ie.text_field(:name,"confirmtext").verify_contains(/CLICK2/i))
@@ -1,18 +1,14 @@
1
1
  # tests for textarea elements
2
- # revision: $Revision: 1260 $
2
+ # revision: $Revision: 1348 $
3
3
 
4
4
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
5
5
  require 'unittests/setup'
6
6
 
7
7
  class TC_TextArea < Test::Unit::TestCase
8
- include Watir
8
+ include Watir::Exception
9
9
 
10
- def use_page page
11
- $ie.goto($htmlRoot + page)
12
- end
13
-
14
10
  def setup
15
- use_page 'textarea.html'
11
+ goto_page 'textarea.html'
16
12
  end
17
13
 
18
14
  def test_elements_exist_or_not
@@ -1,18 +1,17 @@
1
1
  # feature tests for TextArea Fields
2
- # revision: $Revision: 963 $
2
+ # revision: $Revision: 1348 $
3
3
 
4
4
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
5
5
  require 'unittests/setup'
6
6
 
7
7
  class TC_TextArea_XPath < Test::Unit::TestCase
8
- include Watir
8
+ include Watir::Exception
9
9
 
10
- def goto_page
11
- $ie.goto($htmlRoot + "textArea.html")
10
+ def setup
11
+ goto_page "textArea.html"
12
12
  end
13
13
 
14
14
  def test_textarea_field_exists
15
- goto_page
16
15
  #test for existance of 4 text area
17
16
  assert($ie.text_field(:xpath , "//textarea[@name='txtMultiLine1']/").exists?)
18
17
  assert($ie.text_field(:xpath , "//textarea[@name='txtMultiLine2']/").exists?)
@@ -28,15 +27,13 @@ class TC_TextArea_XPath < Test::Unit::TestCase
28
27
  assert(!$ie.text_field(:xpath , "//textarea[@name='txtMultiLine4']/").exists?)
29
28
  end
30
29
 
31
- def test_textarea_to_s
30
+ def xtest_textarea_to_s
32
31
  # bug reported by Zeljko Filipin
33
32
  # assert_nothing_raised { $ie.text_field(:xpath , "//textarea[@id='txtMultiLine3']/").to_s }
34
33
  # The above assertion fails. No property or method called maxlength
35
34
  end
36
35
 
37
36
  def test_textarea_field
38
- goto_page
39
-
40
37
  # test for read only method
41
38
  assert(!$ie.text_field(:xpath , "//textarea[@name='txtMultiLine1']/").readonly? )
42
39
  assert($ie.text_field(:xpath , "//textarea[@name='txtReadOnly']/").readonly?)
@@ -76,7 +73,6 @@ class TC_TextArea_XPath < Test::Unit::TestCase
76
73
 
77
74
  $ie.text_field(:xpath , "//textarea[@name='txtMultiLine2']/").clear
78
75
  assert_equal( "" , $ie.text_field(:xpath , "//textarea[@name='txtMultiLine2']/").value )
79
-
80
76
  end
81
77
 
82
78
  end
@@ -4,7 +4,7 @@ require 'unittests/setup'
4
4
  class TC_Fields_For_Chinese_Char < Test::Unit::TestCase
5
5
 
6
6
  def setup()
7
- $ie.goto($htmlRoot + "textfields1.html")
7
+ goto_page "textfields1.html"
8
8
  end
9
9
 
10
10
  def test_chinese_char_should_be_appended_to_text_field
@@ -1,14 +1,14 @@
1
1
  # feature tests for Text Fields & Labels
2
- # revision: $Revision: 1295 $
2
+ # revision: $Revision: 1348 $
3
3
 
4
4
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
5
5
  require 'unittests/setup'
6
6
 
7
7
  class TC_Fields < Test::Unit::TestCase
8
- include Watir
8
+ include Watir::Exception
9
9
 
10
10
  def setup
11
- $ie.goto($htmlRoot + "textfields1.html")
11
+ goto_page "textfields1.html"
12
12
  end
13
13
 
14
14
  def test_text_field_exists
@@ -210,6 +210,5 @@ class TC_Fields < Test::Unit::TestCase
210
210
 
211
211
  def test_max_length
212
212
  assert_equal(20, $ie.text_field(:name , 'text1').maxLength )
213
-
214
213
  end
215
214
  end
@@ -1,14 +1,14 @@
1
1
  # feature tests for Text Fields
2
- # revision: $Revision: 962 $
2
+ # revision: $Revision: 1348 $
3
3
 
4
4
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 == __FILE__
5
5
  require 'unittests/setup'
6
6
 
7
7
  class TC_Fields_XPath < Test::Unit::TestCase
8
- include Watir
8
+ include Watir::Exception
9
9
 
10
10
  def setup
11
- $ie.goto($htmlRoot + "textfields1.html")
11
+ goto_page "textfields1.html"
12
12
  end
13
13
 
14
14
  def test_text_field_exists
@@ -1,5 +1,5 @@
1
1
  # feature tests for attaching to existing IE windows
2
- # revision: $Revision: 1230 $
2
+ # revision: $Revision: 1348 $
3
3
 
4
4
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..') if $0 == __FILE__
5
5
  require 'unittests/setup'
@@ -8,7 +8,7 @@ class TC_ExistingWindow< Test::Unit::TestCase
8
8
  include Watir
9
9
 
10
10
  def setup
11
- $ie.goto($htmlRoot + 'buttons1.html')
11
+ goto_page 'buttons1.html'
12
12
  end
13
13
  def teardown
14
14
  IE.reset_attach_timeout
@@ -1,5 +1,5 @@
1
1
  # feature tests for attaching to new IE windows
2
- # revision: $Revision: 1230 $
2
+ # revision: $Revision: 1348 $
3
3
 
4
4
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..') if $0 == __FILE__
5
5
  require 'unittests/setup'
@@ -9,7 +9,7 @@ class TC_NewWindow< Watir::TestCase
9
9
  include Watir
10
10
 
11
11
  def setup
12
- $ie.goto($htmlRoot + "new_browser.html")
12
+ goto_page "new_browser.html"
13
13
  end
14
14
  def teardown
15
15
  IE.reset_attach_timeout
@@ -5,17 +5,16 @@ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..') if $0 == __FILE
5
5
  require 'unittests/setup'
6
6
 
7
7
  class TC_CloseWindow < Watir::TestCase
8
- include Watir
9
8
  execute :sequentially
10
9
 
11
10
  def setup
12
- $ie.goto($htmlRoot + "new_browser.html")
11
+ goto_page "new_browser.html"
13
12
  end
14
13
 
15
14
  # reproduces defect http://jira.openqa.org/browse/WTR-16
16
15
  def test_close_window_with_button
17
16
  $ie.link(:text, 'New Window').click
18
- ie_new = IE.attach(:title, 'Pass Page')
17
+ ie_new = Watir::IE.attach(:title, 'Pass Page')
19
18
  assert(ie_new.text.include?('PASS'))
20
19
  assert_nothing_raised {ie_new.close}
21
20
  end
@@ -8,7 +8,7 @@ class TC_Frame_Links < Test::Unit::TestCase
8
8
  include Watir
9
9
 
10
10
  def setup
11
- $ie.goto($htmlRoot + "frame_links.html")
11
+ goto_page "frame_links.html"
12
12
  end
13
13
 
14
14
  def test_click_in_a_frame
@@ -1,5 +1,5 @@
1
1
  # unit tests for iedialog.dll and customized win32ole.so
2
- # revision: $Revision: 1278 $
2
+ # revision: $Revision: 1348 $
3
3
 
4
4
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..') if $0 == __FILE__
5
5
  require 'unittests/setup'
@@ -21,14 +21,14 @@ class TC_IEDialog < Test::Unit::TestCase
21
21
  end
22
22
 
23
23
  def test_find_window
24
- $ie.goto($htmlRoot + "pass.html")
24
+ goto_page "pass.html"
25
25
  fnFindWindow = Win32API.new('user32.dll', 'FindWindow', ['p', 'p'], 'l')
26
26
  hwnd = fnFindWindow.call(nil, "Pass Page - Microsoft Internet Explorer")
27
27
  assert(hwnd != 0)
28
28
  end
29
29
 
30
30
  def test_all
31
- $ie.goto($htmlRoot + "pass.html")
31
+ goto_page "pass.html"
32
32
 
33
33
  fnFindWindow = Win32API.new('user32.dll', 'FindWindow', ['p', 'p'], 'l')
34
34
  hwnd = fnFindWindow.call(nil, "Pass Page - Microsoft Internet Explorer")
@@ -1,14 +1,12 @@
1
1
  # feature tests for JavaScript events
2
- # revision: $Revision: 1177 $
2
+ # revision: $Revision: 1348 $
3
3
 
4
4
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..') if $0 == __FILE__
5
5
  require 'unittests/setup'
6
6
 
7
7
  class TC_JSEvents < Test::Unit::TestCase
8
- include Watir
9
-
10
8
  def setup
11
- $ie.goto($htmlRoot + "javascriptevents.html")
9
+ goto_page "javascriptevents.html"
12
10
  end
13
11
 
14
12
  def test_Button_disabled
@@ -1,5 +1,5 @@
1
1
  # feature tests for modal web dialog support
2
- # revision: $Revision: 1230 $
2
+ # revision: $Revision: 1348 $
3
3
 
4
4
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..') if $0 == __FILE__
5
5
  require 'unittests/setup'
@@ -10,7 +10,7 @@ class TC_ModalDialog < Watir::TestCase
10
10
  include Watir
11
11
 
12
12
  def setup
13
- $ie.goto($htmlRoot + 'modal_dialog_launcher.html')
13
+ goto_page 'modal_dialog_launcher.html'
14
14
  end
15
15
 
16
16
  def teardown
@@ -1,14 +1,12 @@
1
1
  # feature tests for IE#send_keys
2
- # revision: $Revision: 1177 $
2
+ # revision: $Revision: 1348 $
3
3
 
4
4
  $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', '..') if $0 == __FILE__
5
5
  require 'unittests/setup'
6
6
 
7
7
  class TC_Fields < Test::Unit::TestCase
8
- include Watir
9
-
10
8
  def setup
11
- $ie.goto($htmlRoot + "textfields1.html")
9
+ goto_page "textfields1.html"
12
10
  end
13
11
 
14
12
  def test_tabbing
data/watir.rb CHANGED
@@ -71,20 +71,15 @@ end
71
71
  # ARGV needs to be deleted to enable the Test::Unit functionality that grabs
72
72
  # the remaining ARGV as a filter on what tests to run.
73
73
  # Note: this means that watir must be require'd BEFORE test/unit.
74
- def command_line_flag(switch)
75
- setting = ARGV.include?(switch)
76
- ARGV.delete(switch)
77
- return setting
78
- end
79
74
 
80
- # Make Internet Explorer minimize. -b stands for background
81
- $HIDE_IE = command_line_flag('-b')
75
+ # Make Internet Explorer invisible. -b stands for background
76
+ $HIDE_IE = ARGV.delete('-b')
82
77
 
83
78
  # Run fast
84
- $FAST_SPEED = command_line_flag('-f')
79
+ $FAST_SPEED = ARGV.delete('-f')
85
80
 
86
81
  # Eat the -s command line switch (deprecated)
87
- command_line_flag('-s')
82
+ ARGV.delete('-s')
88
83
 
89
84
  require 'watir/logger'
90
85
  require 'watir/win32'
@@ -122,10 +117,7 @@ module Watir
122
117
  ATTACHER.timeout = IE.attach_timeout
123
118
  ATTACHER.wait_until { yield }
124
119
  end
125
-
126
120
 
127
- # Move to Watir::Utils
128
-
129
121
  @@autoit = nil
130
122
 
131
123
  def self.autoit
@@ -154,4 +146,3 @@ def _code_that_copies_readonly_array(array, name)
154
146
  end
155
147
 
156
148
  require 'watir/camel_case'
157
- require 'watir/bonus-elements'
@@ -33,4 +33,12 @@ EOT
33
33
 
34
34
  end
35
35
 
36
- end
36
+ end
37
+ module Test::Unit::Assertions
38
+ def assert_false(boolean, message=nil)
39
+ _wrap_assertion do
40
+ assert_block("assert should not be called with a block.") { !block_given? }
41
+ assert_block(build_message(message, "<?> is not false.", boolean)) { !boolean }
42
+ end
43
+ end
44
+ end
@@ -156,14 +156,6 @@ module Watir
156
156
  end
157
157
  end
158
158
 
159
- class Map < NonControlElement
160
- TAG = 'MAP'
161
- end
162
-
163
- class Area < NonControlElement
164
- TAG = 'AREA'
165
- end
166
-
167
159
  # this class accesses the maps in the document as a collection
168
160
  # Normally a user would not need to create this object as it is returned by the Watir::Container#maps method
169
161
  class Maps < ElementCollections
@@ -181,12 +173,15 @@ module Watir
181
173
  def element_tag; 'AREA'; end
182
174
  end
183
175
 
184
- # this class accesses the imnages in the document as a collection
185
- # Normally a user would not need to create this object as it is returned by the Watir::Container#images method
176
+ # this class collects the images in the container
177
+ # An instance is returned by Watir::Container#images
186
178
  class Images < ElementCollections
187
179
  def element_class; Image; end
188
180
  def length
189
- @container.document.images.length
181
+ all = @container.document.all
182
+ imgs = []
183
+ all.each{|n| imgs << n if n.nodeName == "IMG"}
184
+ imgs.length
190
185
  end
191
186
 
192
187
  private
@@ -478,9 +478,9 @@ module Watir
478
478
  # ie.li(:index,2) # access the second li on the page
479
479
  # ie.li(:title, "A Picture") # access a li using the tooltip text. See http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/title_1.asp?frame=true
480
480
  #
481
- def li(how, what)
482
- return Li.new(self, how, what)
483
- end
481
+ # def li(how, what=nil)
482
+ # return Li.new(self, how, what)
483
+ # end
484
484
 
485
485
  # this is the main method for accessing the lis iterator.
486
486
  #
@@ -511,7 +511,7 @@ module Watir
511
511
  # ie.map(:index,2) # access the second map on the page
512
512
  # ie.map(:title, "A Picture") # access a map using the tooltip text. See http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/title_1.asp?frame=true
513
513
  #
514
- def map(how, what)
514
+ def map(how, what=nil)
515
515
  return Map.new(self, how, what)
516
516
  end
517
517
 
@@ -543,7 +543,7 @@ module Watir
543
543
  # ie.area(:index,2) # access the second area on the page
544
544
  # ie.area(:title, "A Picture") # access a area using the tooltip text. See http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/title_1.asp?frame=true
545
545
  #
546
- def area(how, what)
546
+ def area(how, what=nil)
547
547
  return Area.new(self, how, what)
548
548
  end
549
549
 
@@ -577,7 +577,7 @@ module Watir
577
577
  # ie.image(:alt, "A Picture") # access an image using the alt text
578
578
  # ie.image(:xpath, "//img[@alt='A Picture']/") # access an image using the alt text
579
579
  #
580
- def image(how,what=nil)
580
+ def image(how, what=nil)
581
581
  Image.new(self, how, what)
582
582
  end
583
583
 
@@ -599,24 +599,6 @@ module Watir
599
599
  PopUp.new(self)
600
600
  end
601
601
 
602
- # This is the main method for accessing divs. http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/div.asp?frame=true
603
- # * how - symbol - how we access the div
604
- # * what - string, integer, regular expression or xpath query - what we are looking for,
605
- #
606
- # Valid values for 'how' are listed in the Watir Wiki - http://wiki.openqa.org/display/WTR/Methods+supported+by+Element
607
- #
608
- # returns an Div object
609
- #
610
- # Typical Usage
611
- #
612
- # ie.div(:id, /list/) # access the first div that matches list.
613
- # ie.div(:index,2) # access the second div on the page
614
- # ie.div(:title, "A Picture") # access a div using the tooltip text. See http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/title_1.asp?frame=true
615
- # ie.div(:xpath, "//div[@id='list']/") # access the first div whose id is 'list'
616
- #
617
- def div(how, what=nil)
618
- Div.new(self, how, what)
619
- end
620
602
 
621
603
  # this is the main method for accessing the divs iterator. Returns a Divs collection
622
604
  #
@@ -629,25 +611,7 @@ module Watir
629
611
  def divs
630
612
  Divs.new(self)
631
613
  end
632
-
633
- # This is the main method for accessing span tags - http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/span.asp?frame=true
634
- # * how - symbol - how we access the span,
635
- # * what - string, integer or regular expression - what we are looking for,
636
- #
637
- # Valid values for 'how' are listed in the Watir Wiki - http://wiki.openqa.org/display/WTR/Methods+supported+by+Element
638
- #
639
- # returns a Span object
640
- #
641
- # Typical Usage
642
- #
643
- # ie.span(:id, /list/) # access the first span that matches list.
644
- # ie.span(:index,2) # access the second span on the page
645
- # ie.span(:title, "A Picture") # access a span using the tooltip text. See http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/title_1.asp?frame=true
646
- #
647
- def span(how, what=nil)
648
- Span.new(self, how, what)
649
- end
650
-
614
+
651
615
  # this is the main method for accessing the spans iterator.
652
616
  #
653
617
  # Returns a Spans object
@@ -662,23 +626,6 @@ module Watir
662
626
  Spans.new(self)
663
627
  end
664
628
 
665
- # This is the main method for accessing p tags - http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/p.asp?frame=true
666
- # * how - symbol - how we access the p,
667
- # * what - string, integer or regular expression - what we are looking for,
668
- #
669
- # Valid values for 'how' are listed in the Watir Wiki - http://wiki.openqa.org/display/WTR/Methods+supported+by+Element
670
- #
671
- # returns a P object
672
- #
673
- # Typical Usage
674
- #
675
- # ie.p(:id, /list/) # access the first p tag that matches list.
676
- # ie.p(:index,2) # access the second p tag on the page
677
- # ie.p(:title, "A Picture") # access a p tag using the tooltip text. See http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/title_1.asp?frame=true
678
- #
679
- def p(how, what=nil)
680
- P.new(self, how, what)
681
- end
682
629
 
683
630
  # this is the main method for accessing the ps iterator.
684
631
  #
@@ -693,26 +640,7 @@ module Watir
693
640
  def ps
694
641
  Ps.new(self)
695
642
  end
696
-
697
- # This is the main method for accessing pre tags - http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/pre.asp?frame=true
698
- # * how - symbol - how we access the pre, valid values are
699
- # :index - finds the item using its index
700
- # :id - finds the item using its id attribute
701
- # :name - finds the item using its name attribute
702
- # * what - string, integer or re, what we are looking for,
703
- #
704
- # returns a Pre object
705
- #
706
- # Typical Usage
707
- #
708
- # ie.pre(:id, /list/) # access the first pre tag that matches list.
709
- # ie.pre(:index,2) # access the second pre tag on the page
710
- # ie.pre(:title, "A Picture") # access a pre tag using the tooltip text. See http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/title_1.asp?frame=true
711
- #
712
- def pre(how, what=nil)
713
- Pre.new(self, how, what)
714
- end
715
-
643
+
716
644
  # this is the main method for accessing the ps iterator.
717
645
  #
718
646
  # Returns a Pres object
@@ -726,25 +654,7 @@ module Watir
726
654
  def pres
727
655
  Pres.new(self)
728
656
  end
729
-
730
- # This is the main method for accessing labels. http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/label.asp?frame=true
731
- # * how - symbol - how we access the label,
732
- # * what - string, integer or regular expression - what we are looking for,
733
- #
734
- # Valid values for 'how' are listed in the Watir Wiki - http://wiki.openqa.org/display/WTR/Methods+supported+by+Element
735
- #
736
- # returns a Label object
737
- #
738
- # Typical Usage
739
- #
740
- # ie.label(:id, /list/) # access the first span that matches list.
741
- # ie.label(:index,2) # access the second label on the page
742
- # ie.label(:for, "text_1") # access a the label that is associated with the object that has an id of text_1
743
- #
744
- def label(how, what=nil)
745
- Label.new(self, how, what)
746
- end
747
-
657
+
748
658
  # this is the main method for accessing the labels iterator. It returns a Labels object
749
659
  #
750
660
  # Returns a Labels object