firewatir 1.6.2 → 1.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. data/LICENSE +32 -0
  2. data/lib/firewatir.rb +40 -50
  3. data/lib/firewatir/container.rb +491 -534
  4. data/lib/firewatir/document.rb +239 -0
  5. data/lib/firewatir/element.rb +1365 -0
  6. data/lib/firewatir/element_collections.rb +314 -0
  7. data/lib/firewatir/elements/button.rb +15 -0
  8. data/lib/firewatir/elements/file_field.rb +29 -0
  9. data/lib/firewatir/elements/form.rb +40 -0
  10. data/lib/firewatir/elements/frame.rb +55 -0
  11. data/lib/firewatir/elements/hidden.rb +56 -0
  12. data/lib/firewatir/elements/image.rb +139 -0
  13. data/lib/firewatir/elements/input_element.rb +44 -0
  14. data/lib/firewatir/elements/link.rb +76 -0
  15. data/lib/firewatir/elements/non_control_element.rb +53 -0
  16. data/lib/firewatir/elements/non_control_elements.rb +108 -0
  17. data/lib/firewatir/elements/not_used.rb +278 -0
  18. data/lib/firewatir/elements/option.rb +131 -0
  19. data/lib/firewatir/elements/radio_check_common.rb +163 -0
  20. data/lib/firewatir/elements/select_list.rb +188 -0
  21. data/lib/firewatir/elements/table.rb +218 -0
  22. data/lib/firewatir/elements/table_cell.rb +54 -0
  23. data/lib/firewatir/elements/table_row.rb +100 -0
  24. data/lib/firewatir/elements/text_field.rb +218 -0
  25. data/lib/firewatir/exceptions.rb +10 -10
  26. data/lib/firewatir/firefox.rb +1040 -1127
  27. data/lib/firewatir/jssh_socket.rb +101 -0
  28. data/lib/firewatir/version.rb +5 -5
  29. data/unittests/attach_to_new_window_test.rb +49 -42
  30. data/unittests/bug_fixes_test.rb +195 -198
  31. data/unittests/buttons_xpath_test.rb +88 -88
  32. data/unittests/checkbox_test.rb +158 -155
  33. data/unittests/checkbox_xpath_test.rb +107 -107
  34. data/unittests/div_test.rb +275 -276
  35. data/unittests/filefield_test.rb +49 -45
  36. data/unittests/filefield_xpath_test.rb +35 -35
  37. data/unittests/form_test.rb +296 -308
  38. data/unittests/frame_test.rb +159 -152
  39. data/unittests/hidden_test.rb +85 -85
  40. data/unittests/hidden_xpath_test.rb +72 -72
  41. data/unittests/html/blankpage.html +11 -11
  42. data/unittests/html/buttons1.html +61 -61
  43. data/unittests/html/cssTest.html +42 -42
  44. data/unittests/html/div.html +72 -72
  45. data/unittests/html/fileupload.html +45 -45
  46. data/unittests/html/formTest1.html +38 -38
  47. data/unittests/html/forms2.html +45 -45
  48. data/unittests/html/frame_buttons.html +3 -3
  49. data/unittests/html/iframeTest.html +14 -14
  50. data/unittests/html/iframeTest1.html +13 -13
  51. data/unittests/html/iframeTest2.html +5 -5
  52. data/unittests/html/links1.html +42 -42
  53. data/unittests/html/nestedFrames.html +6 -6
  54. data/unittests/html/new_browser.html +1 -0
  55. data/unittests/html/new_browser_popup.html +8 -0
  56. data/unittests/html/pass.html +9 -9
  57. data/unittests/html/pre.html +27 -27
  58. data/unittests/html/redirect.html +10 -10
  59. data/unittests/html/redirect1.html +8 -8
  60. data/unittests/html/redirect2.html +8 -8
  61. data/unittests/html/redirect3.html +8 -8
  62. data/unittests/html/simple_table_columns.html +74 -74
  63. data/unittests/html/table1.html +165 -165
  64. data/unittests/html/textfields1.html +62 -62
  65. data/unittests/images_test.rb +198 -205
  66. data/unittests/images_xpath_test.rb +118 -119
  67. data/unittests/javascript_test.rb +75 -75
  68. data/unittests/links_test.rb +231 -232
  69. data/unittests/links_xpath_test.rb +79 -79
  70. data/unittests/mozilla_all_tests.rb +7 -7
  71. data/unittests/pre_test.rb +75 -76
  72. data/unittests/radios_xpath_test.rb +101 -101
  73. data/unittests/redirect_test.rb +41 -41
  74. data/unittests/selectbox_test.rb +142 -142
  75. data/unittests/selectbox_xpath_test.rb +129 -129
  76. data/unittests/setup.rb +29 -30
  77. data/unittests/table_test.rb +385 -373
  78. data/unittests/table_xpath_test.rb +185 -185
  79. data/unittests/textfields_test.rb +234 -233
  80. data/unittests/textfields_xpath_test.rb +113 -113
  81. metadata +33 -11
  82. data/lib/firewatir/MozillaBaseElement.rb +0 -1863
  83. data/lib/firewatir/htmlelements.rb +0 -1911
  84. data/unittests/iostring.rb +0 -30
  85. data/unittests/iostring_test.rb +0 -48
@@ -1,152 +1,159 @@
1
- # feature tests for Frames
2
- # revision: $Revision: 1.0 $
3
-
4
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
5
- require 'unittests/setup'
6
-
7
- class TC_Frames < Test::Unit::TestCase
8
-
9
-
10
- def setup
11
- goto_page("frame_buttons.html")
12
- end
13
-
14
- def test_frame_no_what
15
- assert_raises(UnknownFrameException) { browser.frame("missingFrame").button(:id, "b2").enabled? }
16
- assert_raises(UnknownObjectException) { browser.frame("buttonFrame2").button(:id, "b2").enabled? }
17
- assert(browser.frame("buttonFrame").button(:id, "b2").enabled?)
18
- assert_false(browser.frame("buttonFrame").button(:caption, "Disabled Button").enabled?)
19
- end
20
-
21
- def test_frame_using_name
22
- assert_raises(UnknownFrameException) { browser.frame(:name , "missingFrame").button(:id, "b2").enabled? }
23
- assert_raises(UnknownObjectException) { browser.frame(:name, "buttonFrame2").button(:id, "b2").enabled? }
24
- assert(browser.frame(:name, "buttonFrame").button(:id, "b2").enabled?)
25
- assert_false(browser.frame(:name , "buttonFrame").button(:caption, "Disabled Button").enabled?)
26
- end
27
-
28
- def test_frame_using_name_and_regexp
29
- assert_raises(UnknownFrameException) { browser.frame(:name , /missingFrame/).button(:id, "b2").enabled? }
30
- assert(browser.frame(:name, /button/).button(:id, "b2").enabled?)
31
- end
32
-
33
- def test_frame_using_index
34
- assert_raises(UnknownFrameException) { browser.frame(:index, 8).button(:id, "b2").enabled? }
35
- assert_raises(UnknownObjectException) { browser.frame(:index, 2).button(:id, "b2").enabled? }
36
- assert(browser.frame(:index, 1 ).button(:id, "b2").enabled?)
37
- assert_false(browser.frame(:index, 1).button(:caption, "Disabled Button").enabled?)
38
- end
39
-
40
- # def test_frame_with_invalid_attribute
41
- # assert_raises(ArgumentError) { browser.frame(:blah, 'no_such_thing').button(:id, "b2").enabled? }
42
- # end
43
-
44
- def test_preset_frame
45
- # with ruby's instance_eval, we are able to use the same frame for several actions
46
- results = browser.frame("buttonFrame").instance_eval do [
47
- button(:id, "b2").enabled?,
48
- button(:caption, "Disabled Button").enabled?
49
- ]
50
- end
51
- assert_equal([true, false], results)
52
- end
53
-
54
- end
55
-
56
- class TC_Frames2 < Test::Unit::TestCase
57
-
58
-
59
- def setup
60
- goto_page("frame_multi.html")
61
- end
62
-
63
- def test_frame_with_no_name
64
- assert_raises(UnknownFrameException) { browser.frame(:name , "missingFrame").button(:id, "b2").enabled? }
65
- end
66
-
67
- def test_frame_by_id
68
- assert_raises(UnknownFrameException) { browser.frame(:id , "missingFrame").button(:id, "b2").enabled? }
69
- assert(browser.frame(:id, 'first_frame').button(:id, "b2").enabled?)
70
- assert(/.*Test page for buttons.*/ =~ browser.frame(:id, 'first_frame').html)
71
- end
72
- end
73
-
74
- class TC_NestedFrames < Test::Unit::TestCase
75
-
76
-
77
- def setup
78
- goto_page("nestedFrames.html")
79
- end
80
-
81
- def test_frame
82
- assert_raises(UnknownFrameException) { browser.frame("missingFrame").button(:id, "b2").enabled? }
83
- assert_raises(UnknownFrameException) { browser.frame("nestedFrame").frame("subFrame").button(:id, "b2").enabled? }
84
- assert(browser.frame("nestedFrame").frame("senderFrame").button(:name, "sendIt").enabled?)
85
- browser.frame("nestedFrame").frame("senderFrame").text_field(:index, "1").set("Hello")
86
- browser.frame("nestedFrame").frame("senderFrame").button(:name, "sendIt").click
87
- assert(browser.frame("nestedFrame").frame("receiverFrame").text_field(:name, "receiverText").verify_contains("Hello"))
88
- end
89
-
90
- end
91
-
92
- class TC_IFrames < Test::Unit::TestCase
93
-
94
-
95
- def setup
96
- goto_page("iframeTest.html")
97
- end
98
-
99
- def test_Iframe
100
- f = browser.frame("senderFrame")
101
- f.text_field(:name, "textToSend").set("Hello World")
102
- browser.frame("senderFrame").text_field(:name , "textToSend").set( "Hello World")
103
- browser.frame("senderFrame").button(:index, 1).click
104
- assert( browser.frame("receiverFrame").text_field(:name , "receiverText").verify_contains("Hello World") )
105
- end
106
-
107
- end
108
-
109
- require 'unittests/iostring'
110
- class TC_show_frames < Test::Unit::TestCase
111
- include MockStdoutTestCase
112
- tags :fails_on_ie
113
-
114
- def capture_and_compare(page, expected)
115
- goto_page(page)
116
- $stdout = @mockout
117
- browser.showFrames
118
- assert_equal(expected, @mockout)
119
- end
120
-
121
- def test_show_nested_frames
122
- capture_and_compare("nestedFrames.html", <<END_OF_MESSAGE)
123
- There are 2 frames
124
- frame: name: nestedFrame
125
- index: 1
126
- frame: name: nestedFrame2
127
- index: 2
128
- END_OF_MESSAGE
129
- end
130
-
131
- def test_button_frames
132
- capture_and_compare("frame_buttons.html", <<END_OF_MESSAGE)
133
- There are 2 frames
134
- frame: name: buttonFrame
135
- index: 1
136
- frame: name: buttonFrame2
137
- index: 2
138
- END_OF_MESSAGE
139
- end
140
-
141
- def test_iframes
142
- capture_and_compare("iframeTest.html", <<END_OF_MESSAGE)
143
- There are 2 frames
144
- frame: name: senderFrame
145
- index: 1
146
- frame: name: receiverFrame
147
- index: 2
148
- END_OF_MESSAGE
149
- end
150
-
151
- end
152
-
1
+ # feature tests for Frames
2
+ # revision: $Revision: 1.0 $
3
+
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
5
+ require 'unittests/setup'
6
+
7
+ class TC_Frames < Test::Unit::TestCase
8
+
9
+ def setup
10
+ goto_page("frame_buttons.html")
11
+ end
12
+
13
+ tag_method :test_doesnt_exist, :fails_on_firefox, :fails_on_ie # bug WTR-268
14
+ def test_doesnt_exist
15
+ assert_false browser.frame("missingFrame").exists?
16
+ end
17
+
18
+ tag_method :test_exists, :fails_on_ie # related to bug WTR-268
19
+ def test_exists
20
+ assert browser.frame('buttonFrame2').exists?
21
+ end
22
+
23
+ def test_frame_no_what
24
+ assert_raises(UnknownFrameException) { browser.frame("missingFrame").button(:id, "b2").enabled? }
25
+ assert_raises(UnknownObjectException) { browser.frame("buttonFrame2").button(:id, "b2").enabled? }
26
+ assert(browser.frame("buttonFrame").button(:id, "b2").enabled?)
27
+ assert_false(browser.frame("buttonFrame").button(:caption, "Disabled Button").enabled?)
28
+ end
29
+
30
+ def test_frame_using_name
31
+ assert_raises(UnknownFrameException) { browser.frame(:name , "missingFrame").button(:id, "b2").enabled? }
32
+ assert_raises(UnknownObjectException) { browser.frame(:name, "buttonFrame2").button(:id, "b2").enabled? }
33
+ assert(browser.frame(:name, "buttonFrame").button(:id, "b2").enabled?)
34
+ assert_false(browser.frame(:name , "buttonFrame").button(:caption, "Disabled Button").enabled?)
35
+ end
36
+
37
+ def test_frame_using_name_and_regexp
38
+ assert_raises(UnknownFrameException) { browser.frame(:name , /missingFrame/).button(:id, "b2").enabled? }
39
+ assert(browser.frame(:name, /button/).button(:id, "b2").enabled?)
40
+ end
41
+
42
+ def test_frame_using_index
43
+ assert_raises(UnknownFrameException) { browser.frame(:index, 8).button(:id, "b2").enabled? }
44
+ assert_raises(UnknownObjectException) { browser.frame(:index, 2).button(:id, "b2").enabled? }
45
+ assert(browser.frame(:index, 1 ).button(:id, "b2").enabled?)
46
+ assert_false(browser.frame(:index, 1).button(:caption, "Disabled Button").enabled?)
47
+ end
48
+
49
+ # def test_frame_with_invalid_attribute
50
+ # assert_raises(ArgumentError) { browser.frame(:blah, 'no_such_thing').button(:id, "b2").enabled? }
51
+ # end
52
+
53
+ def test_preset_frame
54
+ # with ruby's instance_eval, we are able to use the same frame for several actions
55
+ results = browser.frame("buttonFrame").instance_eval do [
56
+ button(:id, "b2").enabled?,
57
+ button(:caption, "Disabled Button").enabled?
58
+ ]
59
+ end
60
+ assert_equal([true, false], results)
61
+ end
62
+
63
+ end
64
+
65
+ class TC_Frames2 < Test::Unit::TestCase
66
+
67
+
68
+ def setup
69
+ goto_page("frame_multi.html")
70
+ end
71
+
72
+ def test_frame_with_no_name
73
+ assert_raises(UnknownFrameException) { browser.frame(:name , "missingFrame").button(:id, "b2").enabled? }
74
+ end
75
+
76
+ def test_frame_by_id
77
+ assert_raises(UnknownFrameException) { browser.frame(:id , "missingFrame").button(:id, "b2").enabled? }
78
+ assert(browser.frame(:id, 'first_frame').button(:id, "b2").enabled?)
79
+ assert(/.*Test page for buttons.*/ =~ browser.frame(:id, 'first_frame').html)
80
+ end
81
+ end
82
+
83
+ class TC_NestedFrames < Test::Unit::TestCase
84
+
85
+
86
+ def setup
87
+ goto_page("nestedFrames.html")
88
+ end
89
+
90
+ def test_frame
91
+ assert_raises(UnknownFrameException) { browser.frame("missingFrame").button(:id, "b2").enabled? }
92
+ assert_raises(UnknownFrameException) { browser.frame("nestedFrame").frame("subFrame").button(:id, "b2").enabled? }
93
+ assert(browser.frame("nestedFrame").frame("senderFrame").button(:name, "sendIt").enabled?)
94
+ browser.frame("nestedFrame").frame("senderFrame").text_field(:index, "1").set("Hello")
95
+ browser.frame("nestedFrame").frame("senderFrame").button(:name, "sendIt").click
96
+ assert(browser.frame("nestedFrame").frame("receiverFrame").text_field(:name, "receiverText").verify_contains("Hello"))
97
+ end
98
+
99
+ end
100
+
101
+ class TC_IFrames < Test::Unit::TestCase
102
+
103
+
104
+ def setup
105
+ goto_page("iframeTest.html")
106
+ end
107
+
108
+ def test_Iframe
109
+ f = browser.frame("senderFrame")
110
+ f.text_field(:name, "textToSend").set("Hello World")
111
+ browser.frame("senderFrame").text_field(:name , "textToSend").set( "Hello World")
112
+ browser.frame("senderFrame").button(:index, 1).click
113
+ assert( browser.frame("receiverFrame").text_field(:name , "receiverText").verify_contains("Hello World") )
114
+ end
115
+
116
+ end
117
+
118
+ class TC_show_frames < Test::Unit::TestCase
119
+ include CaptureIOHelper
120
+ tags :fails_on_ie
121
+
122
+ def capture_and_compare(page, expected)
123
+ goto_page(page)
124
+ actual = capture_stdout { browser.showFrames }
125
+ assert_equal(expected, actual)
126
+ end
127
+
128
+ def test_show_nested_frames
129
+ capture_and_compare("nestedFrames.html", <<END_OF_MESSAGE)
130
+ There are 2 frames
131
+ frame: name: nestedFrame
132
+ index: 1
133
+ frame: name: nestedFrame2
134
+ index: 2
135
+ END_OF_MESSAGE
136
+ end
137
+
138
+ def test_button_frames
139
+ capture_and_compare("frame_buttons.html", <<END_OF_MESSAGE)
140
+ There are 2 frames
141
+ frame: name: buttonFrame
142
+ index: 1
143
+ frame: name: buttonFrame2
144
+ index: 2
145
+ END_OF_MESSAGE
146
+ end
147
+
148
+ def test_iframes
149
+ capture_and_compare("iframeTest.html", <<END_OF_MESSAGE)
150
+ There are 2 frames
151
+ frame: name: senderFrame
152
+ index: 1
153
+ frame: name: receiverFrame
154
+ index: 2
155
+ END_OF_MESSAGE
156
+ end
157
+
158
+ end
159
+
@@ -1,85 +1,85 @@
1
- # feature tests for Input Hidden elements
2
- # revision: $Revision: 1.0 $
3
-
4
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
5
- require 'unittests/setup'
6
-
7
- class TC_Hidden_Fields < Test::Unit::TestCase
8
- def setup
9
- goto_page("forms3.html")
10
- end
11
-
12
- def test_hidden
13
-
14
- # test using index
15
- assert( browser.hidden(:index,1).exists? )
16
- assert( browser.hidden(:index,2).exists? )
17
- assert_false( browser.hidden(:index,3).exists? )
18
-
19
- browser.hidden(:index,1).value = 44
20
- browser.hidden(:index,2).value = 55
21
-
22
- browser.button(:value , "Show Hidden").click
23
-
24
- assert_equal("44" , browser.text_field(:name , "vis1").value )
25
- assert_equal("55" , browser.text_field(:name , "vis2").value )
26
-
27
- # test using name and ID
28
- assert( browser.hidden(:name ,"hid1").exists? )
29
- assert( browser.hidden(:id,"hidden_1").exists? )
30
- assert_false( browser.hidden(:name,"hidden_44").exists? )
31
- assert_false( browser.hidden(:id,"hidden_55").exists? )
32
-
33
- browser.hidden(:name ,"hid1").value = 444
34
- browser.hidden(:id,"hidden_1").value = 555
35
-
36
- browser.button(:value , "Show Hidden").click
37
-
38
- assert_equal("444" , browser.text_field(:name , "vis1").value )
39
- assert_equal("555" , browser.text_field(:name ,"vis2").value )
40
-
41
- # test the over-ridden append method
42
- browser.hidden(:name ,"hid1").append("a")
43
- browser.button(:value , "Show Hidden").click
44
- assert_equal("444a" , browser.text_field(:name , "vis1").value )
45
- assert_equal("555" , browser.text_field(:name ,"vis2").value )
46
-
47
- # test the over-ridden clear method
48
- browser.hidden(:name ,"hid1").clear
49
- browser.button(:value , "Show Hidden").click
50
- assert_equal("" , browser.text_field(:name , "vis1").value )
51
- assert_equal("555" , browser.text_field(:name ,"vis2").value )
52
-
53
- # test using a form
54
- assert( browser.form(:name , "has_a_hidden").hidden(:name ,"hid1").exists? )
55
- assert( browser.form(:name , "has_a_hidden").hidden(:id,"hidden_1").exists? )
56
- assert_false( browser.form(:name , "has_a_hidden").hidden(:name,"hidden_44").exists? )
57
- assert_false( browser.form(:name , "has_a_hidden").hidden(:id,"hidden_55").exists? )
58
-
59
- browser.form(:name , "has_a_hidden").hidden(:name ,"hid1").value = 222
60
- browser.form(:name , "has_a_hidden").hidden(:id,"hidden_1").value = 333
61
-
62
- browser.button(:value , "Show Hidden").click
63
-
64
- assert_equal("222" , browser.text_field(:name , "vis1").value )
65
- assert_equal("333" , browser.text_field(:name ,"vis2").value )
66
-
67
- # iterators
68
- assert_equal(2, browser.hiddens.length)
69
- count =1
70
- browser.hiddens.each do |h|
71
- case count
72
- when 1
73
- assert_equal( "", h.id)
74
- assert_equal( "hid1", h.name)
75
- when 2
76
- assert_equal( "", h.name)
77
- assert_equal( "hidden_1", h.id)
78
- end
79
- count+=1
80
- end
81
-
82
- assert_equal("hid1" , browser.hiddens[1].name )
83
- assert_equal("hidden_1" , browser.hiddens[2].id )
84
- end
85
- end
1
+ # feature tests for Input Hidden elements
2
+ # revision: $Revision: 1.0 $
3
+
4
+ $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') unless $SETUP_LOADED
5
+ require 'unittests/setup'
6
+
7
+ class TC_Hidden_Fields < Test::Unit::TestCase
8
+ def setup
9
+ goto_page("forms3.html")
10
+ end
11
+
12
+ def test_hidden
13
+
14
+ # test using index
15
+ assert( browser.hidden(:index,1).exists? )
16
+ assert( browser.hidden(:index,2).exists? )
17
+ assert_false( browser.hidden(:index,3).exists? )
18
+
19
+ browser.hidden(:index,1).value = 44
20
+ browser.hidden(:index,2).value = 55
21
+
22
+ browser.button(:value , "Show Hidden").click
23
+
24
+ assert_equal("44" , browser.text_field(:name , "vis1").value )
25
+ assert_equal("55" , browser.text_field(:name , "vis2").value )
26
+
27
+ # test using name and ID
28
+ assert( browser.hidden(:name ,"hid1").exists? )
29
+ assert( browser.hidden(:id,"hidden_1").exists? )
30
+ assert_false( browser.hidden(:name,"hidden_44").exists? )
31
+ assert_false( browser.hidden(:id,"hidden_55").exists? )
32
+
33
+ browser.hidden(:name ,"hid1").value = 444
34
+ browser.hidden(:id,"hidden_1").value = 555
35
+
36
+ browser.button(:value , "Show Hidden").click
37
+
38
+ assert_equal("444" , browser.text_field(:name , "vis1").value )
39
+ assert_equal("555" , browser.text_field(:name ,"vis2").value )
40
+
41
+ # test the over-ridden append method
42
+ browser.hidden(:name ,"hid1").append("a")
43
+ browser.button(:value , "Show Hidden").click
44
+ assert_equal("444a" , browser.text_field(:name , "vis1").value )
45
+ assert_equal("555" , browser.text_field(:name ,"vis2").value )
46
+
47
+ # test the over-ridden clear method
48
+ browser.hidden(:name ,"hid1").clear
49
+ browser.button(:value , "Show Hidden").click
50
+ assert_equal("" , browser.text_field(:name , "vis1").value )
51
+ assert_equal("555" , browser.text_field(:name ,"vis2").value )
52
+
53
+ # test using a form
54
+ assert( browser.form(:name , "has_a_hidden").hidden(:name ,"hid1").exists? )
55
+ assert( browser.form(:name , "has_a_hidden").hidden(:id,"hidden_1").exists? )
56
+ assert_false( browser.form(:name , "has_a_hidden").hidden(:name,"hidden_44").exists? )
57
+ assert_false( browser.form(:name , "has_a_hidden").hidden(:id,"hidden_55").exists? )
58
+
59
+ browser.form(:name , "has_a_hidden").hidden(:name ,"hid1").value = 222
60
+ browser.form(:name , "has_a_hidden").hidden(:id,"hidden_1").value = 333
61
+
62
+ browser.button(:value , "Show Hidden").click
63
+
64
+ assert_equal("222" , browser.text_field(:name , "vis1").value )
65
+ assert_equal("333" , browser.text_field(:name ,"vis2").value )
66
+
67
+ # iterators
68
+ assert_equal(2, browser.hiddens.length)
69
+ count =1
70
+ browser.hiddens.each do |h|
71
+ case count
72
+ when 1
73
+ assert_equal( "", h.id)
74
+ assert_equal( "hid1", h.name)
75
+ when 2
76
+ assert_equal( "", h.name)
77
+ assert_equal( "hidden_1", h.id)
78
+ end
79
+ count+=1
80
+ end
81
+
82
+ assert_equal("hid1" , browser.hiddens[1].name )
83
+ assert_equal("hidden_1" , browser.hiddens[2].id )
84
+ end
85
+ end