Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8993737
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:15:38+00:00 2026-06-15T23:15:38+00:00

Currently, I’m running all selenium scripts in my test suite (written by Selenium Ruby

  • 0

Currently, I’m running all selenium scripts in my test suite (written by Selenium Ruby Webdriver) at one time by using rake gem in “Start Command Prompt with Ruby” terminal.

To do this I have to create a file with name “rakefile.rb” with below content and just call “rake” in my terminal: (I have known this knowledge based on the guide of a person in my previous post how to export results when running selenium ruby webdriver scripts to output files from command prompt ruby window).

task :default do
    $stdout = File.new('console.out', 'w')

    $stdout.sync = true


    FileList['test*.rb'].each { |file|
    begin
      ruby file

     rescue

      puts "The following tests reported unexpected behavior:"
          puts "#{file} \n"
     end
     }
end

However, I do not know how to modify “rakefile.rb” to be able to export the content of executing each failed tests (that being displayed on my Terminal) to each output file ? It means that I expect the content of executing each my script will be written to output files instead of displaying on my Ruby terminal (ex: when I’m running the test script “test_GI-1.rb”, then the content of executing this script will be written to an output file “test_GI-1.rb.out” instead of showing in my Terminal.

I modified my “rakefile.rb” to something like ruby file >> test.rb.out, but it does not work at all (this thing only works when I type directly the thing like ruby test.rb >> output.out on my Ruby Terminal). Anybody please guide me a way. Thanks so much.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:15:39+00:00Added an answer on June 15, 2026 at 11:15 pm

    I have not tried this out, but I guess this should work

    task :default do
    FileList['test*.rb'].each { |file|
     begin
       system("ruby #{file} > #{file}.log")
      rescue
       puts "The following tests reported unexpected behavior:"
       puts "#{file} \n"
      end
    }
    end
    

    Based on new requirements –

    UPDATE


    task :default do
        logfile.new("console.out", "w")
        FileList['test*.rb'].each { |file|
         begin
           system("ruby #{file} > #{file}.log")
          rescue
           logfile.puts("The following tests reported unexpected behavior:")
           logfile.puts("#{file} \n")
          end
          }
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I am using HTML files for parts of my user interface. I display
currently, I`m implementing a map App with Mono4Droid and there I`m using a WebView
Currently I'm starting a new Activity and calling finish on a current one. Is
Currently I am trying to use a bunch of custom perl modules, test.pm as
Currently I use /etc/init.d/supervisor restart but this restarts all processes under supervisor. Is there
Currently we use log4net of version 1.2.10.0 and we should start using some 3rd
Currently we are using Trac . Tickets are good for tracking tasks and related
Currently using Oracle/BEA/Plumtree ALUI Portal 6.1, and am trying to display a client's IP
Currently I am working in message compose screen in Android, Using Intent to show
Currently I am creating VBA Macros for Excel and recently have started using UserForms.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.