Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix Form#name

  • Loading branch information...
commit 72a4dc1c049fe37f8d92168b4714cd8129ad56c0 1 parent d53cb1e
@jarmo jarmo authored
Showing with 7 additions and 32 deletions.
  1. +7 −2 watir/lib/watir/form.rb
  2. +0 −30 watir/unittests/form_test.rb
View
9 watir/lib/watir/form.rb
@@ -7,11 +7,16 @@ def initialize(container, specifiers)
end
attr_ole :action
- attr_ole :name
+
+ def name
+ assert_exists
+ name = ole_object.getAttributeNode('name')
+ name ? name.value : ''
+ end
def form_method
assert_exists
- @o.invoke('method')
+ ole_object.invoke('method')
end
def method(arg = nil)
View
30 watir/unittests/form_test.rb
@@ -80,36 +80,6 @@ def test_forms_collection
end
end
-class TC_Form_Display < Test::Unit::TestCase
- include CaptureIOHelper
- def test_showforms
- goto_page "forms2.html"
- actual = capture_stdout { browser.showForms }
- expected = <<END_OF_MESSAGE
-There are 4 forms
-Form name:
- id:
- method: get
- action: pass.html
-Form name: test2
- id: f2
- method: get
- action: pass2.html
-Form name: test3
- id:
- method: get
- action: pass2.html
-Form name: test2
- id:
- method: get
- action: pass2.html
-END_OF_MESSAGE
- actual.gsub!(/(action: )file:.*\/(.*)$/,'\\1\\2') if actual =~ /file:/
- actual.gsub!(/\s+\n/,"\n")
- assert_equal(expected, actual)
- end
-end
-
class TC_Forms3 < Test::Unit::TestCase
def setup
goto_page "forms3.html"
Please sign in to comment.
Something went wrong with that request. Please try again.