Is this your entire script? require 'minitest/autorun' > require 'watir-webdriver' > $browser = Watir::Browser.new > def test_there_should_be_text_About_Google > $browser.goto("http://www.google.com") > assert(browser.text.include?("About Google")) > end >
----- remove these > end class Minitesttest<MiniTest::Test If this is your entire test the end is ending nothing and your class is invoked incorrectly. The above with the bottom two lines removed should work fine. On Friday, July 18, 2014 2:58:32 PM UTC-6, Dimitri Reynaga wrote: > > Hey guys, > > > I'm trying to use minitest within my watir automation scripts and i've run > into an issue where using a global variable causes an error. Below you'll > find the code and the error > > > require 'minitest/autorun' >> require 'watir-webdriver' >> $browser = Watir::Browser.new >> def test_there_should_be_text_About_Google >> $browser.goto("http://www.google.com") >> assert(browser.text.include?("About Google")) >> end >> end > > class Minitesttest<MiniTest::Test >> > > > Run options: --seed 63580 >> >> # Running: >> E >> Finished in 0.005151s, 194.1371 runs/s, 0.0000 assertions/s. >> 1) Error: >> Minitesttest#test_there_should_be_text_About_Google: >> EOFError: end of file reached >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/protocol.rb:153:in >> `read_nonblock' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/protocol.rb:153:in >> `rbuf_fill' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/protocol.rb:134:in >> `readuntil' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/protocol.rb:144:in >> `readline' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/http/response.rb:39:in >> >> `read_status_line' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/http/response.rb:28:in >> >> `read_new' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:1408:in >> `block in transport_request' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:1405:in >> `catch' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:1405:in >> `transport_request' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:1378:in >> `request' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:1371:in >> `block in request' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:853:in >> `start' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/net/http.rb:1369:in >> `request' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/remote/http/default.rb:83:in >> >> `response_for' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/remote/http/default.rb:39:in >> >> `request' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/remote/http/common.rb:40:in >> >> `call' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/remote/bridge.rb:634:in >> >> `raw_execute' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/remote/bridge.rb:612:in >> >> `execute' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/remote/bridge.rb:110:in >> >> `get' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.42.0/lib/selenium/webdriver/common/navigation.rb:14:in >> >> `to' >> >> /Users/dimitri/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/watir-webdriver-0.6.10/lib/watir-webdriver/browser.rb:77:in >> >> `goto' >> /Users/dimitri/Documents/workspace/TTQA/minitesttest.rb:9:in >> `test_there_should_be_text_About_Google' >> 1 runs, 0 assertions, 0 failures, 1 errors, 0 skips >> >> > I realize that running the test with a local variable will result in > success, but i'm using global variables throughout my other automation > scripts. Any help is greatly appreciated! > -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to watir-general+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.