Hmmm, there's quite a lot going on here. Where to begin.

Classnames must be capitalized:

class MainTestManage
 not
class mainTestManage

I'm not sure why you've defined a module nor why you're explicitly naming
your class names in your module with the as class methods.

You maintestManage class is inheriting from TestCase but has no tests
defined since test methods called by TestCase need to be defined by using
test at the beginning of the method name.

Here's a quick hack to your example though I may be missing the actual jist
of what you're attempting to do.

require 'watir'
include Watir
require 'test/unit'
require 'test/unit/ui/console/testrunner'
#require 'win32ole'  #already loaded by watir
class MaintestManage  < Test::Unit::TestCase
       def setup
         $ie = IE.start('www.xxx.com)    # moving this into the setup
method
       end
       def test_manage               # removed main from the beginning so
it's a test case
              mt = MainTestAPI::MainTest.new
               mt.test1()
               mt.test2()                     # this test does nothing
               mt.test3()
       end
       def teardown            # adding ie.close to the teardown, since
you're calling all your tests in the main test anyhow
          $ie.close
          sleep 1
       end
end
module MaintestAPI               # module names like class names begin with
a capital letter
 class MainTest                    # classes begin with capital letter,
removed previous class name from your method definitions, not necessary
   def test1()
     $ie.text_field(:id, 'UserID').set('ABCD1234')
     $ie.text_field(:id, PWD).set('123456')
     $ie.button(:id, 'Login').click
   end
   def test2()

   end
   def test3()
     $ie.link(:url, 'Logout.aspx').click
   end
 end
end


Hopefully this help explain some things, or if not maybe explain your
reasoning behind your particular version.

-Charley


On 4/19/07, vamsi <[EMAIL PROTECTED]> wrote:

Hi,

Getting an Calling fuction error .... Please find the script and error
message below.

require 'watir'
include Watir
require 'test/unit'
require 'test/unit/ui/console/testrunner'
require 'win32ole'
class maintestManage  < Test::Unit::TestCase
        def maintestManage
                maintest.test1()
                maintest.test2()
                maintest.test3()
        end
end
module maintestAPI
       class maintest
                def maintest.test1()
                        $ie = IE.new
                        $ie.goto('www.xxx.com)
                        $ie.text_field(:id, 'UserID').set('ABCD1234')
                        $ie.text_field(:id, PWD).set('123456')
                        $ie.button(:id, 'Login').click
                end
                def maintest.test2()

                end
                def maintest.test3()
                        $ie.link(:url, 'Logout.aspx').click
                        $ie.close
                end
        end
end


Error Message:  1) Failure:
default_test(maintestManage) [maintestmanagesignonAPI.rb:28]:
No tests were specified.


Kindly help me into this....
Thansk in Advance.

Regards
Vamsi
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to