Stefan Lang
4/9/2008 12:00:00 PM
2008/4/9, Pranjal Jain <pranjal.jain123@gmail.com>:
> Hi All
> I ma trying to call the function written in one script in other script.
> But it is giving me the error.
>
> The called script is 2.rb
>
> require 'watir'
> def test_b
>
> $ie1 = IE.new
>
> $ie1.text_field(:name, "q").set "pickaxe"
> $ie1.button(:name, "btnG").click
> #ie.showAllObjects
> end
>
> the calling script is 1.rb
>
> require 'watir'
> require '2'
>
> class TestCase
>
> def test_a
> $ie = IE.new
> $ie.goto 'www.google.com'
> end
> test_b
> end
>
>
> The error popped is as follows:
>
> ./2.rb:4: in 'test_b': uninitialized constant IE(NameError)
> from 1.rb:10
I've never used Watir myself, but looking at the API docs it
looks like you should replace references to IE with
Watir::IE.
HTH,
Stefan