Search code examples
rubywatirscite

Watir, How can i fetch the errors it displays after running a test script and place it on a file


Im new to watir and running scripts from it. Just want to ask if how can I get or extract the error messages Scite displays on the left panel and import it to a textfile? or is it really possible to do? Thanks.


Solution

  • I am not sure how would you do it from Scite, but if you execute Watir script from command line, you can redirect output to file:

    $ ruby watir_script.rb > results.txt
    

    If you use test framework like RSpec, there are a lot of options for storing test results in files.