Re: [Wtr-general] undefined method `[]' for

2007-01-24 Thread John Lolis
 Another way to say this is:
 
   t.each {|x| puts x[0]}

I'm enjoying this thread, heres another way. Sans 0!

for element in (t.index(t.first)..t.index(t.last))
puts t[element].first
end
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6230messageID=17595#17595
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???

2007-01-24 Thread Paul Carvalho

On 23/01/07, Bret Pettichord wrote:


This is largely because Watir is stupid in this area. We made a bad
design choice with Watir 1.0. We'd now like to make Watir consistent and
start with 0 everywhere (like everything else in Ruby) but this would
raise compatibility issues. We welcome your thoughts in this area.



I think being consistent everywhere would be a good thing.  If that means
being consistent with Ruby and starting at 0, then so be it.

Personally, I think the person who first coded programming/scripting
languages to start counting at 0 should have had his/her head examined and
then been committed to an insane asylum.  I've learnt many programming
languages over the years and even once sat and painfully read through a
series of programming language manuals as long as a desk shelf back almost
20 years ago.  I still recall how that language was hailed as a
Fourth-Generation Language that was supposed to make programming easier
because the syntax and vocabulary (commands, methods, etc) were closer to
more natural language.  It seemed ironic that the easier the language was
supposed to be, the more manuals were required to teach you how to program
in it.

The point here is that it is natural for human beings to start counting at
1.  I have never in my entire life ever heard anyone start counting at 0.
*That* is stupid.

So, Paul, how many children do you have?  Well, my first boy would be 0,
and my second son would be 1, so I guess I have 1 child.  Even the Cat in
the Hat's best friends are Thing 1 and Thing 2.  I would have like to
have heard Dr. Seuss' thoughts on the topic of counting.

If machines can't be made to speak *our* language, then they're not very
useful.  Forcing people to think and code in that way is an impediment to
clear, human thought IMHO.

In the absence of something good, I'll take something consistent.  The
enemy you know and all that, right?  If you want to attract
non-programmers to the use of the tool, then you will have to appeal to them
in a friendly, non-programming way.  (That would include not forcing them to
rethink how to count because that's not a friendly thing to do.)

I recall Gracie Hopper once saying that if you hear the phrase that's the
way it's always been done then you know it's time to change it.

Well, you asked for my thoughts. ;-)  Thanks for asking.  Let me just put
this soapbox away for now.. ;-)

Cheers.  Paul C.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???

2007-01-24 Thread mi
Whoever you are, you are FREAKING FUNNY and made an excellent point 
here:-) 
 So, Paul, how many children do you have?  Well, my first boy would 
 be 0, and my second son would be 1, so I guess I have 1 child.  Even 
 the Cat in the Hat's best friends are Thing 1 and Thing 2.  I 
 would have like to have heard Dr. Seuss' thoughts on the topic of 
 counting.

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


Re: [Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???

2007-01-24 Thread Bret Pettichord
Željko Filipin wrote:

 We'd now like to make Watir consistent and start with 0 everywhere
 (like everything else in Ruby) but this would raise compatibility
 issues. We welcome your thoughts in this area.


 I vote for start with 0 everywhere.
Here is where you and everyone with an opinion should vote: 
http://jira.openqa.org/browse/WTR-61

It would not be hard to change Watir, if we don't care about backwards 
compatibility. But if we do care, then this becomes a more difficult change.

Bret

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

Re: [Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???

2007-01-24 Thread Paul Rogers
do we have the ability to vote 
'Yes - with no backwards compatability'
'Yes - with backwards compatability'
or 'No'

or just yes or no


Ive just grepped my code and found 196 occurrances of :index :-(


Paul



- Original Message -
From: Bret Pettichord [EMAIL PROTECTED]
Date: Wednesday, January 24, 2007 2:40 pm
Subject: Re: [Wtr-general] undefined method `[]' for nil:NilClass 
(NoMethodError) error at the end of array???

 Željko Filipin wrote:
 
  We'd now like to make Watir consistent and start with 0 
 everywhere (like everything else in Ruby) but this would 
 raise compatibility
  issues. We welcome your thoughts in this area.
 
 
  I vote for start with 0 everywhere.
 Here is where you and everyone with an opinion should vote: 
 http://jira.openqa.org/browse/WTR-61
 
 It would not be hard to change Watir, if we don't care about 
 backwards 
 compatibility. But if we do care, then this becomes a more 
 difficult change.
 
 Bret
 
 ___
 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


Re: [Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???

2007-01-24 Thread Bret Pettichord
Paul Rogers wrote:
 do we have the ability to vote 
 'Yes - with no backwards compatability'
 'Yes - with backwards compatability'
 or 'No'

 or just yes or no
   
I created two sub tickets. Vote for the one you want.

Without backwards compatibility
http://jira.openqa.org/browse/WTR-135

With backwards compatibility
http://jira.openqa.org/browse/WTR-134


But realize that if you vote for this ticket, that means that you don't 
want 0-based indexing in Watir ever unless it has backwards 
compatability. In other words, it is probably a no.

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


Re: [Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???

2007-01-23 Thread Chris McMahon
On 1/22/07, mi [EMAIL PROTECTED] wrote:
 t = [[a, b], [aa, bb]]

 0.upto (t.length) { |x|
 puts t[x][0]
 }

 For some reason i'm getting the following error at the end of the loop,
 any idea WHY???

0.upto (t.length-1) { |x|
 puts t[x][0]
 }

should do it, but I think you figured that out.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???

2007-01-23 Thread Paul Carvalho

This is one of those times when I'll never understand why some things in
programming start counting at 1 and some things start counting at 0.

I, too, have several similar loops in some of my scripts, but I opted for
the more readable format of saying:

t.length.times { |x|
   puts t[x][0]
}

I just can't be bothered with loops like 1.upto(t.length) {|x| puts x}
which, technically, counts from the first item to the last item, but
really x starts counting at 0 and goes to (length - 1).  This might be
convenient if you are working with arrays but not a whole lot else.

Paul C.



On 23/01/07, Chris McMahon [EMAIL PROTECTED] wrote:


On 1/22/07, mi [EMAIL PROTECTED] wrote:
 t = [[a, b], [aa, bb]]

 0.upto (t.length) { |x|
 puts t[x][0]
 }

 For some reason i'm getting the following error at the end of the loop,
 any idea WHY???

0.upto (t.length-1) { |x|
 puts t[x][0]
}

should do it, but I think you figured that out.

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

Re: [Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???

2007-01-23 Thread Bret Pettichord
Paul Carvalho wrote:
 This is one of those times when I'll never understand why some things 
 in programming start counting at 1 and some things start counting at 0.
This is largely because Watir is stupid in this area. We made a bad 
design choice with Watir 1.0. We'd now like to make Watir consistent and 
start with 0 everywhere (like everything else in Ruby) but this would 
raise compatibility issues. We welcome your thoughts in this area.
 I, too, have several similar loops in some of my scripts, but I opted 
 for the more readable format of saying:

 t.length.times { |x|
 puts t[x][0]
 }
Another way to say this is:

  t.each {|x| puts x[0]}

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


Re: [Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???

2007-01-23 Thread Željko Filipin

On 1/24/07, Bret Pettichord [EMAIL PROTECTED] wrote:


We'd now like to make Watir consistent and start with 0 everywhere (like
everything else in Ruby) but this would raise compatibility issues. We
welcome your thoughts in this area.



I vote for start with 0 everywhere.
--
Zeljko Filipin
zeljkofilipin.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???

2007-01-22 Thread mi
sorry, i keep forgetting that the array starts at 0:-(

mi wrote:
 t = [[a, b], [aa, bb]]

 0.upto (t.length) { |x|
puts t[x][0]
 }

 For some reason i'm getting the following error at the end of the 
 loop, any idea WHY??? a
 aa
 undefined method `[]' for nil:NilClass (NoMethodError)

 Thanks in advance!

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


Re: [Wtr-general] undefined method - clickWindowsButton

2006-08-08 Thread Charley Baker
Hi Chintakrindi,  You should be able to do this by creating a new WinClicker object:  wc = WinClicker.new wc.clickWindowsButton(Microsoft Internet Explorer, OK)-Charley
On 8/8/06, Chintakrindi Meghanath [EMAIL PROTECTED] wrote:
Hi AllI am using the clickWindowsButton to handle window pop ups in my application.
But its throwing error undefined method.I even inculded winClicker.rb in my script.Can anyone help me out ?ThanksMeghanath___Wtr-general mailing list
Wtr-general@rubyforge.orghttp://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Undefined Method Error

2006-03-24 Thread Zeljko Filipin
Add this at the beggining of your script:require test/unit/assertionsinclude Test::Unit::AssertionsOn 3/23/06, 
[EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
I want to make assertions in test_myTestCase.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Undefined Method Error

2006-03-23 Thread David.J.Solis

Bret,

Here is a better example of what I'm doing. In the code below I created
a class with a method that makes a call to method in another class. I
want to make assertions in test_myTestCase. If I uncomment the assertion
in test_myTestCase, I get an error. How can I assert in the called
method?

If I do this, the program runs:

require 'test/unit'
require 'test/unit/ui/console/testrunner'

class TC_MyTest  Test::Unit::TestCase
  def test_myMethod 
puts 'test 1'
  assert(true, 'test 1')
@test = TC_MyClass.new()
@test_new = @test.test_myTestCase
  end
End

class TC_MyClass 
  def initialize 
  end
  def test_myTestCase
puts 'test 2'
  #assert(true, 'test 2')
puts 'test 3'
puts 'test 4'
  end  
end  

If I do this, the program gives me errors:

class TC_MyTest  Test::Unit::TestCase
  def test_myMethod 
puts 'test 1'
  assert(true, 'test 1')
@test = TC_MyClass.new()
@test_new = @test.test_myTestCase
  end
End

class TC_MyClass  Test::Unit::TestCase
  def initialize 
  end
  def test_myTestCase
puts 'test 2'
  assert(true, 'test 2')
puts 'test 3'
puts 'test 4'
  end  
end  



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Bret Pettichord
Sent: Monday, March 20, 2006 9:09 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Undefined Method Error

David,

That error message indicates that $ie is nil, which is to say, it hasn't
been initialized. It needs to be assigned in the test_* method or the
initialize method. (Or you need to get fancy, which is what we do in our
unit tests.)

You said that you are trying to structure your test scripts. I suggest
you do this in smaller steps. First just put the common code in a
separate method (not called test*) in the same class. Then move it
outside the class. And only then move it to a new file. There are small
gotcha's with each step, so it's worth taking these small steps until
you understand the source of each of them.

Bret

On 3/20/06, David Solis [EMAIL PROTECTED] wrote:


 Hello,

 I'm running into a problem I think is a probably a programming error
in my part.

 Here  is what I'm trying to accomplish: I have script with 2800 lines
of  code. My test cases in the script have many repeatable steps. For
each  test case, I'm basically coding the same steps over an over again
and  thus I get hundreds of lines of code.

 My  first inclination was to break out the test and make them into
separate  files so that the script is not so big and less error prone.
But I  would be doing the same thing as I was doing earlier except now I
would  have to maintain many files rather one.

 So  what I want to do is create a method that contains the repeatable
steps  that are used in every test case and call the method when I need
to  execute the steps. The method would live in separate file. Sounds
easy,  right?  Well, when I try to a get this error:!

 1) Error:
 test_steps(AccountManagementSteps):
 NoMethodError: undefined method `link' for nil:NilClass
 ./negative_tierI_steps.rb:37:in `test_steps'
 2) Error:
 test_01_account_management(TC_Negative):
 ArgumentError: wrong number of arguments (0 for 1)

C:/automation/src/thdf/projects/core/testharness/fixtures/admin_administ
ration/tc_tierI_negative_tests.rb:67:in `initialize'

C:/automation/src/thdf/projects/core/testharness/fixtures/admin_administ
ration/tc_tierI_negative_tests.rb:67:in `new'

C:/automation/src/thdf/projects/core/testharness/fixtures/admin_administ
ration/tc_tierI_negative_tests.rb:67:in  `test_01_account_management'

 Here  is the code. The method I'm calling is called
AccountManagementSteps.  Require 'setup' halls my require statements
including so I know the  script has the proper require statements.
require  'negative_tierI_steps.rb' contains the steps that are given me
the  problem.

 require 'setup'
 require  'negative_tierI_steps.rb'

 TOPDIR = File.join(File.dirname(__FILE__), '..') $LOAD_PATH.unshift 
 TOPDIR


 class TC_Negative   Test::Unit::TestCase

 def test_01_account_management
 puts ''; puts '';
 puts  Starting Test Class: TC_tierI_negative_tests
;
 puts ''
 puts 'Executing test 01 - Account Management Access'
 puts ''
   @login = Login.new($user, $password, $url, $submit_key);
# create a random Admin user name
@random_name = UserRandomName.new();
$username = @random_name.User();
# Create a new AdminUser
@admin_user = CreateUser.new($username);
# Verify that user was created
assert($ie.contains_text($save_msg));
 @login.logout(admin);
  assert($ie.contains_text($logoff_msg));
 @login.shutdown();
 # Login as  superuser
  @login = Login.new($user, $password, $url,
$submit_key);
  @group_details = 0
 set_group

Re: [Wtr-general] undefined method `add_assertion' for nil:NilClass

2006-03-21 Thread Bret Pettichord
On 3/21/06, Paatsch, Bernd [EMAIL PROTECTED] wrote:
 def
  .some code
begin

I suspect your problem is somewhere in here.

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


Re: [Wtr-general] undefined method `add_assertion' for nil:NilCla ss

2006-03-21 Thread Paatsch, Bernd
Title: RE: [Wtr-general] undefined method `add_assertion' for nil:NilClass





Still the same after I changed the code to:


 def bpVerifyPopupWindowOpen( ieCont, verify) #how, what, framename, verify ) 
 begin
  assert( ieCont.contains_text( verify) )
  puts(TEST PASSED. Found test string 'Programming Ruby' ) 
 rescue = e
 puts(TEST FAILED. + e.message + \n + e.backtrace.join(\n)) 
 end


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Bret Pettichord
Sent: Tuesday, March 21, 2006 5:46 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] undefined method `add_assertion' for nil:NilClass


On 3/21/06, Paatsch, Bernd [EMAIL PROTECTED] wrote:
 def
 .some code
 begin


I suspect your problem is somewhere in here.


___
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

Re: [Wtr-general] undefined method `add_assertion' for nil:NilCla ss

2006-03-21 Thread Paatsch, Bernd
Title: RE: [Wtr-general] undefined method `add_assertion' for nil:NilCla ss





Now I get:
TEST FAILED.undefined method `include' for (WebAC::BPUtils):WebAC::BPUtils 


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Bret Pettichord
Sent: Tuesday, March 21, 2006 6:37 PM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] undefined method `add_assertion' for nil:NilCla ss


That's what i needed to see. Make this change...


On 3/21/06, Paatsch, Bernd [EMAIL PROTECTED] wrote:
 Still the same after I changed the code to:

 def bpVerifyPopupWindowOpen( ieCont, verify) #how, what, 
 framename, verify )
 begin
 include Test::Unit::Assertions
 assert( ieCont.contains_text( verify) )
 puts(TEST PASSED. Found test string 'Programming Ruby' )

 rescue = e
 puts(TEST FAILED. + e.message + \n +
 e.backtrace.join(\n))
 end



 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED]] On Behalf Of Bret 
 Pettichord
 Sent: Tuesday, March 21, 2006 5:46 PM
 To: wtr-general@rubyforge.org
 Subject: Re: [Wtr-general] undefined method `add_assertion' for 
 nil:NilClass

 On 3/21/06, Paatsch, Bernd [EMAIL PROTECTED] wrote:
  def
  .some code
  begin

 I suspect your problem is somewhere in here.


 ___
 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




___
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

Re: [Wtr-general] undefined method `add_assertion' for nil:NilCla ss

2006-03-21 Thread Bret Pettichord
Oops.

Put the include statement before the def instead of inside it.

On 3/21/06, Paatsch, Bernd [EMAIL PROTECTED] wrote:


 Now I get:
 TEST FAILED.undefined method `include' for (WebAC::BPUtils):WebAC::BPUtils

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 Bret Pettichord
 Sent: Tuesday, March 21, 2006 6:37 PM
 To: wtr-general@rubyforge.org
 Subject: Re: [Wtr-general] undefined method `add_assertion' for nil:NilCla
 ss




 That's what i needed to see. Make this change...

 On 3/21/06, Paatsch, Bernd [EMAIL PROTECTED] wrote:
  Still the same after I changed the code to:
 
  def bpVerifyPopupWindowOpen( ieCont, verify) #how, what,
  framename, verify )
 begin
  include Test::Unit::Assertions
assert( ieCont.contains_text( verify) )
puts(TEST PASSED. Found test string 'Programming Ruby' )
 
   rescue = e
   puts(TEST FAILED. + e.message + \n +
  e.backtrace.join(\n))
   end
 
 
 
  -Original Message-
  From: [EMAIL PROTECTED]
  [mailto:[EMAIL PROTECTED] On Behalf Of
 Bret
  Pettichord
  Sent: Tuesday, March 21, 2006 5:46 PM
  To: wtr-general@rubyforge.org
  Subject: Re: [Wtr-general] undefined method `add_assertion' for
  nil:NilClass
 
  On 3/21/06, Paatsch, Bernd [EMAIL PROTECTED] wrote:
   def
.some code
  begin
 
  I suspect your problem is somewhere in here.
 
 
  ___
  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
 
 


 ___

 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



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


Re: [Wtr-general] Undefined Method Error

2006-03-20 Thread Bret Pettichord
David,

That error message indicates that $ie is nil, which is to say, it
hasn't been initialized. It needs to be assigned in the test_* method
or the initialize method. (Or you need to get fancy, which is what we
do in our unit tests.)

You said that you are trying to structure your test scripts. I suggest
you do this in smaller steps. First just put the common code in a
separate method (not called test*) in the same class. Then move it
outside the class. And only then move it to a new file. There are
small gotcha's with each step, so it's worth taking these small steps
until you understand the source of each of them.

Bret

On 3/20/06, David Solis [EMAIL PROTECTED] wrote:


 Hello,

 I'm running into a problem I think is a probably a programming error in my 
 part.

 Here  is what I'm trying to accomplish: I have script with 2800 lines of  
 code. My test cases in the script have many repeatable steps. For each  test 
 case, I'm basically coding the same steps over an over again and  thus I get 
 hundreds of lines of code.

 My  first inclination was to break out the test and make them into separate  
 files so that the script is not so big and less error prone. But I  would be 
 doing the same thing as I was doing earlier except now I would  have to 
 maintain many files rather one.

 So  what I want to do is create a method that contains the repeatable steps  
 that are used in every test case and call the method when I need to  execute 
 the steps. The method would live in separate file. Sounds easy,  right?  
 Well, when I try to a get this error:!

 1) Error:
 test_steps(AccountManagementSteps):
 NoMethodError: undefined method `link' for nil:NilClass
 ./negative_tierI_steps.rb:37:in `test_steps'
 2) Error:
 test_01_account_management(TC_Negative):
 ArgumentError: wrong number of arguments (0 for 1)
 
 C:/automation/src/thdf/projects/core/testharness/fixtures/admin_administration/tc_tierI_negative_tests.rb:67:in
  `initialize'
 
 C:/automation/src/thdf/projects/core/testharness/fixtures/admin_administration/tc_tierI_negative_tests.rb:67:in
  `new'
   
 C:/automation/src/thdf/projects/core/testharness/fixtures/admin_administration/tc_tierI_negative_tests.rb:67:in
   `test_01_account_management'

 Here  is the code. The method I'm calling is called AccountManagementSteps.  
 Require 'setup' halls my require statements including so I know the  script 
 has the proper require statements. require  'negative_tierI_steps.rb' 
 contains the steps that are given me the  problem.

 require 'setup'
 require  'negative_tierI_steps.rb'

 TOPDIR = File.join(File.dirname(__FILE__), '..')
 $LOAD_PATH.unshift TOPDIR


 class TC_Negative   Test::Unit::TestCase

 def test_01_account_management
 puts ''; puts '';
 puts  Starting Test Class: TC_tierI_negative_tests   
 ;
 puts ''
 puts 'Executing test 01 - Account Management Access'
 puts ''
   @login = Login.new($user, $password, $url, $submit_key);
# create a random Admin user name
@random_name = UserRandomName.new();
$username = @random_name.User();
# Create a new AdminUser
@admin_user = CreateUser.new($username);
# Verify that user was created
assert($ie.contains_text($save_msg));
 @login.logout(admin);
  assert($ie.contains_text($logoff_msg));
 @login.shutdown();
 # Login as  superuser
  @login = Login.new($user, $password, $url, 
 $submit_key);
  @group_details = 0
 set_group = SetPermission.new()
   set_group.fSteps(@group_details);
assert($ie.contains_text($save_msg));
  @login.logout(admin);
assert($ie.contains_text($logoff_msg));
  @login.shutdown();

  ! @login =Login.new($username, $password, $url, 
 $submit_key);
 @steps = AccountManagementSteps.new()
 @steps.test_steps()
end

 This is the code in the method I'm calling.

 require 'setup'
 require 'watir'
 require 'test/unit'
 require 'test/unit/ui/console/testrunner'
 require 'watir/testUnitAddons'

 class AccountManagementSteps  Test::Unit::TestCase

   def initialize()
   end

 def   test_steps()
 $ie.link(:text, Account management).click();
assert($ie.contains_text(Manage Accounts));
 $ie.link(:text, Manage settings).click();
assert($ie.contains_text($no_autho_msg));
 $ie.link(:text, Manage affiliates).click();
assert($ie.contains_text($no_autho_msg));
   $ie.link(:text, Admin authentication).click();
 $ie.link(:text, AAUT).click();
   assert($ie.contains_text($no_autho_msg));
 $ie.link(:text, Payment processing).click();

Re: [Wtr-general] undefined method `document' for nil:NilClass = Error

2005-10-26 Thread Jesús JCE . Collado Pérez










Hi folks, 



two weeks ago I send a bug to this mailing list about undefined method `document' for nil:NilClass =
Error as you can see below, and no one could help me out.



Ive found the solution. Its
quite simple. You can just launch the sentence written in Watir under your WET
script. 



This seems to be a specific WET bug. I think that
maybe useful for any other WET bugs. You can go around the bug using Watir
sentences, while a fix is found in WET. 



I hope this could help to anyone. 



Cheers 





-Mensaje original-
De: Jesús JCE. Collado Pérez 
Enviado el: jueves, 13 de octubre de 2005 18:21
Para: 'wtr-general@rubyforge.org'
Asunto: undefined method `document' for nil:NilClass = Error



Hi folks, 



I've found a weird error using WET and I'm afraid this
may be a WET bug (I hope it's just my fault with code ;-) )



I'm trying to set either a text field and a checkbox
that is found in a second level frame as following:



Browser(url:=http://server/app/principal.jsp).Frame(name:=frame1).Frame(name:=frame2).TextField(name:=testfield).set
Testing



The focus move to the text field but it seems to fail
when trying to write. This is what I get:



undefined method `document' for nil:NilClass =
Error



This is really driving me crazy so I'll appreciate any
kind of help with this issue and hope this help to more people. 



Thanks in advance





Jesús Collado Pérez

Testing Engineer

Southern Star

 

[EMAIL PROTECTED]

Tel: 91 372 80 22








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


Re: [Wtr-general] Undefined method getObject when attempting to do a set on a text field.

2005-08-29 Thread Raghu Venkataramana

Hi Stephanie,

Are you using a released version of Watir 1.4 or something off the SCM 
repository?


I was trying to locate the source of the problem from your stack trace:

from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'

and in the version(s) of Watir1.4 that I have, I could not find neither
assert_exists method in line number 1766 nor 'set' method at 3368. If you 
are using a version from the SCM could you tell me the exact revision number
so that I could check the same version out here and try it. 


Thanks
Raghu




Stephanie Mayfield wrote:


I apologize in advance if this question has already been asked.  I'm
new to the list and the hunting and pecking in the archives didn't
turn up an answer.  (Aside: is there a search engine on the archives?)

My problem is I'm getting an error when attempting to do a very simple
assignment to a text field.

require 'WET'
include WET

ie=Browser.new()
ie.goto http://URL here
ie.show_all_objects

puts username object exists:  + ie.TextField(name:=username).to_s
ie.TextField(name:=username).set('first.last')


My output confirms that the username field does in fact exist on the page:

username object exists: WebEdit(name:=username)

But then I get this exception: 



D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined
method `getObject' for nil:NilClass (NoMethodError)
from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
from D:/ruby/lib/ruby/site_ruby/1.8/qantom/webobjects/WebEdit.rb:59:in 
`set'
from D:/ruby/myRuby/AdminTest/simple.rb:9

I'm not sure if this is a WET issue or a Watir issue.  What I'm running on is: 
-	Win XP

-   Watir v1.4
-   WET v0.5.1 (for water v1.4, doesn't include the optional component)

Watir by itself access the website just fine, however I have
JavaScript pop-ups so I'm attempting to use WET to access those.

The URL and username do not contain any extended characters.

Assistance is greatly appreciated!

 




--
Qantom Software

http://www.qantom.com
Ph : 26799269 Xtn. 125
sip : [EMAIL PROTECTED]
--

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


Re: [Wtr-general] Undefined method getObject when attempting to do a set on a text field.

2005-08-29 Thread Stephanie Mayfield
Raghu,

I installed 1.4 originally then I overwrote that installation via the
gem.  The gem is listed as 1.4.1.
Thanks for looking into this!

Steph


On 8/29/05, Raghu Venkataramana [EMAIL PROTECTED] wrote:
 Hi Stephanie,
 
 Are you using a released version of Watir 1.4 or something off the SCM
 repository?
 
 I was trying to locate the source of the problem from your stack trace:
 
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
 
 and in the version(s) of Watir1.4 that I have, I could not find neither
 assert_exists method in line number 1766 nor 'set' method at 3368. If you
 are using a version from the SCM could you tell me the exact revision number
 so that I could check the same version out here and try it.
 
 Thanks
 Raghu
 
 
 
 
 Stephanie Mayfield wrote:
 
 I apologize in advance if this question has already been asked.  I'm
 new to the list and the hunting and pecking in the archives didn't
 turn up an answer.  (Aside: is there a search engine on the archives?)
 
 My problem is I'm getting an error when attempting to do a very simple
 assignment to a text field.
 
 require 'WET'
 include WET
 
 ie=Browser.new()
 ie.goto http://URL here
 ie.show_all_objects
 
 puts username object exists:  + ie.TextField(name:=username).to_s
 ie.TextField(name:=username).set('first.last')
 
 
 My output confirms that the username field does in fact exist on the page:
 
 username object exists: WebEdit(name:=username)
 
 But then I get this exception:
 
 
 D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined
 method `getObject' for nil:NilClass (NoMethodError)
from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
from 
  D:/ruby/lib/ruby/site_ruby/1.8/qantom/webobjects/WebEdit.rb:59:in `set'
from D:/ruby/myRuby/AdminTest/simple.rb:9
 
 I'm not sure if this is a WET issue or a Watir issue.  What I'm running on 
 is:
 -  Win XP
 -  Watir v1.4
 -  WET v0.5.1 (for water v1.4, doesn't include the optional component)
 
 Watir by itself access the website just fine, however I have
 JavaScript pop-ups so I'm attempting to use WET to access those.
 
 The URL and username do not contain any extended characters.
 
 Assistance is greatly appreciated!
 
 
 
 
 
 --
 Qantom Software
 
 http://www.qantom.com
 Ph : 26799269 Xtn. 125
 sip : [EMAIL PROTECTED]
 --
 
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 


-- 
Steph
Homepage: www.maesah.ca

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


Re: [Wtr-general] Undefined method getObject when attempting to do a set on a text field.

2005-08-29 Thread Raghu Venkataramana

Hi Stephanie,

This is getting intersting. I just did a gem install of watir myself, 
but still

couldn't find the method 'locate' as shown by:

D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in 
`locate': undefined


However I got the latest version HEAD version from cvs
repository and that version _does_ have the locate method
that is giving you the trouble. I took a quick look at that 
code and unfortunately wet's current version wont work 
with that implementation. For the current version of WET 
you need to make sure that you use the version that got 
installed off from the gem and not the CVS version. 

Your best bet may be to simply copy the Watir.rb from 
d:\ruby\lib\ruby\gems\1.8\gems\watir-1.4.1.rb to 
D:/ruby/lib/ruby/site_ruby/1.8/watir.rb 


Thanks
Raghu





Stephanie Mayfield wrote:


Raghu,

I installed 1.4 originally then I overwrote that installation via the
gem.  The gem is listed as 1.4.1.
Thanks for looking into this!

Steph


On 8/29/05, Raghu Venkataramana [EMAIL PROTECTED] wrote:
 


Hi Stephanie,

Are you using a released version of Watir 1.4 or something off the SCM
repository?

I was trying to locate the source of the problem from your stack trace:

   from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
   from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'

and in the version(s) of Watir1.4 that I have, I could not find neither
assert_exists method in line number 1766 nor 'set' method at 3368. If you
are using a version from the SCM could you tell me the exact revision number
so that I could check the same version out here and try it.

Thanks
Raghu




Stephanie Mayfield wrote:

   


I apologize in advance if this question has already been asked.  I'm
new to the list and the hunting and pecking in the archives didn't
turn up an answer.  (Aside: is there a search engine on the archives?)

My problem is I'm getting an error when attempting to do a very simple
assignment to a text field.

require 'WET'
include WET

ie=Browser.new()
ie.goto http://URL here
ie.show_all_objects

puts username object exists:  + ie.TextField(name:=username).to_s
ie.TextField(name:=username).set('first.last')


My output confirms that the username field does in fact exist on the page:

username object exists: WebEdit(name:=username)

But then I get this exception:


D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined
method `getObject' for nil:NilClass (NoMethodError)
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
 from D:/ruby/lib/ruby/site_ruby/1.8/qantom/webobjects/WebEdit.rb:59:in 
`set'
 from D:/ruby/myRuby/AdminTest/simple.rb:9

I'm not sure if this is a WET issue or a Watir issue.  What I'm running on is:
-  Win XP
-  Watir v1.4
-  WET v0.5.1 (for water v1.4, doesn't include the optional component)

Watir by itself access the website just fine, however I have
JavaScript pop-ups so I'm attempting to use WET to access those.

The URL and username do not contain any extended characters.

Assistance is greatly appreciated!



 


--
Qantom Software

http://www.qantom.com
Ph : 26799269 Xtn. 125
sip : [EMAIL PROTECTED]
--

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

   




 




--
Qantom Software

http://www.qantom.com
Ph : 26799269 Xtn. 125
sip : [EMAIL PROTECTED]
--

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


Re: [Wtr-general] Undefined method getObject when attempting to do a set on a text field.

2005-08-29 Thread Stephanie Mayfield
Raghu,

My simple case works!  But I had to replace all the .rb files from the
gem, not just the watir one. I have no idea how I got the CVS version
of Watir installed.  Thanks so much for the help!

Steph



On 8/29/05, Raghu Venkataramana [EMAIL PROTECTED] wrote:
 Hi Stephanie,
 
 This is getting intersting. I just did a gem install of watir myself,
 but still
 couldn't find the method 'locate' as shown by:
 
 D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in
 `locate': undefined
 
 However I got the latest version HEAD version from cvs
 repository and that version _does_ have the locate method
 that is giving you the trouble. I took a quick look at that
 code and unfortunately wet's current version wont work
 with that implementation. For the current version of WET
 you need to make sure that you use the version that got
 installed off from the gem and not the CVS version.
 
 Your best bet may be to simply copy the Watir.rb from
 d:\ruby\lib\ruby\gems\1.8\gems\watir-1.4.1.rb to
 D:/ruby/lib/ruby/site_ruby/1.8/watir.rb
 
 Thanks
 Raghu
 
 
 
 
 
 Stephanie Mayfield wrote:
 
 Raghu,
 
 I installed 1.4 originally then I overwrote that installation via the
 gem.  The gem is listed as 1.4.1.
 Thanks for looking into this!
 
 Steph
 
 
 On 8/29/05, Raghu Venkataramana [EMAIL PROTECTED] wrote:
 
 
 Hi Stephanie,
 
 Are you using a released version of Watir 1.4 or something off the SCM
 repository?
 
 I was trying to locate the source of the problem from your stack trace:
 
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
 
 and in the version(s) of Watir1.4 that I have, I could not find neither
 assert_exists method in line number 1766 nor 'set' method at 3368. If you
 are using a version from the SCM could you tell me the exact revision number
 so that I could check the same version out here and try it.
 
 Thanks
 Raghu
 
 
 
 
 Stephanie Mayfield wrote:
 
 
 
 I apologize in advance if this question has already been asked.  I'm
 new to the list and the hunting and pecking in the archives didn't
 turn up an answer.  (Aside: is there a search engine on the archives?)
 
 My problem is I'm getting an error when attempting to do a very simple
 assignment to a text field.
 
 require 'WET'
 include WET
 
 ie=Browser.new()
 ie.goto http://URL here
 ie.show_all_objects
 
 puts username object exists:  + ie.TextField(name:=username).to_s
 ie.TextField(name:=username).set('first.last')
 
 
 My output confirms that the username field does in fact exist on the page:
 
 username object exists: WebEdit(name:=username)
 
 But then I get this exception:
 
 
 D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined
 method `getObject' for nil:NilClass (NoMethodError)
   from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
   from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
   from 
  D:/ruby/lib/ruby/site_ruby/1.8/qantom/webobjects/WebEdit.rb:59:in `set'
   from D:/ruby/myRuby/AdminTest/simple.rb:9
 
 I'm not sure if this is a WET issue or a Watir issue.  What I'm running on 
 is:
 -  Win XP
 -  Watir v1.4
 -  WET v0.5.1 (for water v1.4, doesn't include the optional component)
 
 Watir by itself access the website just fine, however I have
 JavaScript pop-ups so I'm attempting to use WET to access those.
 
 The URL and username do not contain any extended characters.
 
 Assistance is greatly appreciated!
 
 
 
 
 
 --
 Qantom Software
 
 http://www.qantom.com
 Ph : 26799269 Xtn. 125
 sip : [EMAIL PROTECTED]
 --
 
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 
 
 
 
 
 
 
 
 
 --
 Qantom Software
 
 http://www.qantom.com
 Ph : 26799269 Xtn. 125
 sip : [EMAIL PROTECTED]
 --
 
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general
 


-- 
Steph
Homepage: www.maesah.ca

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


Re: [Wtr-general] Undefined method getObject when attempting to do a set on a text field.

2005-08-29 Thread Bret Pettichord
I'm pretty sure than none of the Watir releases included the 'locate' 
method -- that is only in head.


When we created the 1.4.1 release, we were careful to only include minor 
fixes and updates that we were pretty sure would not break WET (for 1.4).


It may be worth noting that the regular installers (either the old 1.4 and 
earlier or the new 1.4.1 one-click installer) install watir into a 
different location than the gem. I do not know what happens if watir is 
installed both ways. I suspect that one would overrule the other, but i 
don't know which.


The best bet is to uninstall one version of Watir before installing a new 
version. Both of the installers for 1.4.1 have uninstall options. (Prior to 
that we didn't.)


Bret

At 10:45 AM 8/29/2005, Raghu Venkataramana wrote:

Hi Stephanie,

This is getting intersting. I just did a gem install of watir myself, but 
still

couldn't find the method 'locate' as shown by:

D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined

However I got the latest version HEAD version from cvs
repository and that version _does_ have the locate method
that is giving you the trouble. I took a quick look at that code and 
unfortunately wet's current version wont work with that implementation. 
For the current version of WET you need to make sure that you use the 
version that got installed off from the gem and not the CVS version.
Your best bet may be to simply copy the Watir.rb from 
d:\ruby\lib\ruby\gems\1.8\gems\watir-1.4.1.rb to 
D:/ruby/lib/ruby/site_ruby/1.8/watir.rb

Thanks
Raghu





Stephanie Mayfield wrote:


Raghu,

I installed 1.4 originally then I overwrote that installation via the
gem.  The gem is listed as 1.4.1.
Thanks for looking into this!

Steph


On 8/29/05, Raghu Venkataramana [EMAIL PROTECTED] wrote:



Hi Stephanie,

Are you using a released version of Watir 1.4 or something off the SCM
repository?

I was trying to locate the source of the problem from your stack trace:

   from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
   from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'

and in the version(s) of Watir1.4 that I have, I could not find neither
assert_exists method in line number 1766 nor 'set' method at 3368. If you
are using a version from the SCM could you tell me the exact revision number
so that I could check the same version out here and try it.

Thanks
Raghu




Stephanie Mayfield wrote:




I apologize in advance if this question has already been asked.  I'm
new to the list and the hunting and pecking in the archives didn't
turn up an answer.  (Aside: is there a search engine on the archives?)

My problem is I'm getting an error when attempting to do a very simple
assignment to a text field.

require 'WET'
include WET

ie=Browser.new()
ie.goto http://URL here
ie.show_all_objects

puts username object exists:  + ie.TextField(name:=username).to_s
ie.TextField(name:=username).set('first.last')


My output confirms that the username field does in fact exist on the page:

username object exists: WebEdit(name:=username)

But then I get this exception:


D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3205:in `locate': undefined
method `getObject' for nil:NilClass (NoMethodError)
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1766:in `assert_exists'
 from D:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3368:in `set'
 from 
D:/ruby/lib/ruby/site_ruby/1.8/qantom/webobjects/WebEdit.rb:59:in `set'

 from D:/ruby/myRuby/AdminTest/simple.rb:9

I'm not sure if this is a WET issue or a Watir issue.  What I'm running 
on is:

-  Win XP
-  Watir v1.4
-  WET v0.5.1 (for water v1.4, doesn't include the optional component)

Watir by itself access the website just fine, however I have
JavaScript pop-ups so I'm attempting to use WET to access those.

The URL and username do not contain any extended characters.

Assistance is greatly appreciated!





--
Qantom Software

http://www.qantom.com
Ph : 26799269 Xtn. 125
sip : [EMAIL PROTECTED]
--

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









--
Qantom Software

http://www.qantom.com
Ph : 26799269 Xtn. 125
sip : [EMAIL PROTECTED]
--

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


_
 Bret Pettichord
 www.pettichord.com

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