[wtr-general] Re: Error in installation of gem

2009-12-18 Thread Alister Scott
If you don't wish to completely reinstall ruby, a much easier thing to
do is manually install rubygems 1.3.5 from a zip file:
http://rubyforge.org/frs/?group_id=126
This will fix the problem.

-- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


Re: [wtr-general] Re: How to wait following an external frame link click.

2009-12-18 Thread Željko Filipin
On Fri, Dec 18, 2009 at 1:13 AM, bender25 zuzi...@yahoo.com wrote:
 I have extended my default wait timeout period to 20 mins

20 minutes! :)

Željko

-- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general

Re: [wtr-general] Using begin statement doesn't return the no. of failures and errors

2009-12-18 Thread Charley Baker
Hey there,

   You're using a rescue clause to catch every exception, the testrunner is
relying on Exceptions to report out results. What you probably want to do is
something like this:

begin
  assert(b.text.include?('Programming Ruby'))
  puts('test passed')
rescue Test::Unit::AssertionFailedError = e
  puts ('test failed' + e.message)
  add_failure(e)
end

You can also add multiple rescue clauses to rescue other types of errors or
a catchall below this one, depending on what you want. There's a
corresponding add_error method to add errors. :)

hth,

Charley





On Thu, Dec 17, 2009 at 8:32 PM, Marlon marlonmoja...@gmail.com wrote:

 Hi guys,
 I'm sorry if you will find this question silly but I'm a ruby  watir
 newby. My question is, why it is that when I'm using begin statement
 on assertions the result is not getting the no. failures and errors
 meaning when the script fails the failure and error is zero ex.

 ==test_script=
 require 'watir'
 require 'test/unit'
 require 'test/unit/ui/console/testrunner'

 class TC_google_assert  Test::Unit::TestCase

  def test_print_assertion
   test_site = 'http://www.google.com/'
   $browser = Watir::Browser.new
   $browser.goto(test_site)
   $browser.text_field(:name, q).set(watir)
   $browser.button(:name, btnG).click
   begin
  assert($browser.text.include?(Programming Ruby) )
  puts(TEST PASSED. Found test string 'Programming Ruby' )
   rescue = e
 puts(TEST FAILED. + e.message + \n + e.backtrace.join
 (\n))
   end
  end
 end
 =produces===

 ruby testbegin.rb
 Loaded suite testbegin
 Started
 TEST FAILED.false is not true.
 c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:48:in `assert_block'
 c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:500:in `_wrap_assertion'
 c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:46:in `assert_block'
 c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:63:in `assert'
 c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:495:in `_wrap_assertion'
 c:/ruby/lib/ruby/1.8/test/unit/assertions.rb:61:in `assert'
 testbegin.rb:14:in `test_print_assertion'
 c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:78:in `__send__'
 c:/ruby/lib/ruby/1.8/test/unit/testcase.rb:78:in `run'
 c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
 c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
 c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
 c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:34:in `run'
 c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `each'
 c:/ruby/lib/ruby/1.8/test/unit/testsuite.rb:33:in `run'
 c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnermediator.rb:46:in
 `run_suite'
 c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:67:in
 `start_mediator'
 c:/ruby/lib/ruby/1.8/test/unit/ui/console/testrunner.rb:41:in `start'
 c:/ruby/lib/ruby/1.8/test/unit/ui/testrunnerutilities.rb:29:in `run'
 c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'
 c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
 c:/ruby/lib/ruby/1.8/test/unit.rb:278
 testbegin.rb:7
 .
 Finished in 9.406 seconds.

 1 tests, 1 assertions, 0 failures, 0 errors
 Exit code: 0




 but executing the script w/out the begin statement ex.

 ==test_script=
 require 'watir'
 require 'test/unit'
 require 'test/unit/ui/console/testrunner'

 class TC_google_assert  Test::Unit::TestCase

  def test_print_assertion
   test_site = 'http://www.google.com/'
   $browser = Watir::Browser.new
   $browser.goto(test_site)
   $browser.text_field(:name, q).set(watir)
   $browser.button(:name, btnG).click
   assert($browser.text.include?(Programming Ruby) )
  end
 end
 =produces===
 ruby testbegin.rb
 Loaded suite testbegin
 Started
 F
 Finished in 7.672 seconds.

  1) Failure:
 test_print_assertion(TC_google_assert) [testbegin.rb:14]:
 false is not true.

 1 tests, 1 assertions, 1 failures, 0 errors
 Exit code: 1




 Can I get the no. of failures and errors using begin statement?


 Thanks
 -Marlon

 --
 You received this message because you are subscribed to the Google Groups
 Watir General group.
 To post to this group, send email to watir-general@googlegroups.com
 Before posting, please read the following guidelines:
 http://wiki.openqa.org/display/WTR/Support
 To unsubscribe from this group, send email to
 watir-general-unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/watir-general

-- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general

[wtr-general] Re: Using begin statement doesn't return the no. of failures and errors

2009-12-18 Thread Marlon
Hi Charley,

Thanks for help! this is great ,problem is solved. But I forgot to
tell you that I'm using ci_reporter. It seems there's a problem
converting the report to xml. This is the error logs

..c:/ruby/lib/ruby/gems/1.8/gems/ci_reporter-1.6.0/lib/ci/reporter/
test_suite.rb:84:in `trunc!': private method `sub' called for
#Test::Unit::AssertionFailedError: false is not true.
(NoMethodError)
from c:/ruby/lib/ruby/gems/1.8/gems/ci_reporter-1.6.0/lib/ci/
reporter/test_suite.rb:138:in `to_xml'
from c:/ruby/lib/ruby/gems/1.8/gems/ci_reporter-1.6.0/lib/ci/
reporter/test_suite.rb:137:in `each'
from c:/ruby/lib/ruby/gems/1.8/gems/ci_reporter-1.6.0/lib/ci/
reporter/test_suite.rb:137:in `to_xml'
from c:/ruby/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/
xmlbase.rb:134:in `call'
from c:/ruby/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/
xmlbase.rb:134:in `_nested_structures'
from c:/ruby/lib/ruby/gems/1.8/gems/builder-2.1.2/lib/builder/
xmlbase.rb:58:in `method_missing'
from c:/ruby/lib/ruby/gems/1.8/gems/ci_reporter-1.6.0/lib/ci/
reporter/test_suite.rb:136:in `to_xml'
from c:/ruby/lib/ruby/gems/1.8/gems/ci_reporter-1.6.0/lib/ci/
reporter/test_suite.rb:91:in `to_xml'
 ... 20 levels...
from c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:216:in `run'
from c:/ruby/lib/ruby/1.8/test/unit/autorunner.rb:12:in `run'
from c:/ruby/lib/ruby/1.8/test/unit.rb:278

error with this function===

test_suite.rb

def to_xml
builder = create_builder
# more recent version of Builder doesn't need the escaping
def builder.trunc!(txt)
  txt.sub(/\n.*/m, '...') ---error is coming from
end
builder.instruct!
attrs = {}
each_pair {|k,v| attrs[k] = builder.trunc!(v.to_s) unless
v.nil? || v.to_s.empty? }
builder.testsuite(attrs) do
  @testcases.each do |tc|
tc.to_xml(builder)
  end
  builder.tag! system-out do
builder.cdata! self.stdout
  end
  builder.tag! system-err do
builder.cdata! self.stderr
  end
end
  end


Thanks!
-Marlon

-- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] What to do when getting an error updaing ruby gems, or updating watir gem on Ruby 1.8.6.26

2009-12-18 Thread Alister Scott
Hi,

I have noticed problems when updating rubygems (gem update --system),
or updating your watir gem, when using Ruby 1.8.6.26.

I have added this to the FAQ on the wiki:
http://wiki.openqa.org/display/WTR/FAQ#FAQ-Ican%27tinstalltheWatirgem%2CorupdaterubygemsonRuby1.8.6.26%2CwhatdoIdo%3F

EG:

I can't install the Watir gem, or update rubygems on Ruby 1.8.6.26,
what do I do?

If you are getting an error like:

Updating RubyGems...
Attempting remote update of rubygems-update
Install required dependency builder? [Yn] Y
ERROR: While executing gem ... (Gem::GemNotFoundException)
Could not find builder (= 0) in any repository

What you need to do is manually install the latest version of
rubygems. Download the zip file from http://rubyforge.org/frs/?group_id=126,
extract it and run setup.rb.
Once you have done this the commands gem install watir and gem
update watir will work correctly.

Cheers,
Alister

-- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general


[wtr-general] Re: Error in installation of gem

2009-12-18 Thread Alister Scott

On Dec 19, 7:58 am, mxparker mxpar...@gmail.com wrote:
 Just a thought... I had a similar issue. And on another thread I
 learned that the problem turned out to be the fact that I was behind a
 corporate firewall. When I took laptop home I was able to update the
 gems.

That's an entirely separate issue.

-- 
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general