why the warning? and how can I solve it?
/usr/lib/ruby/gems/1.8/gems/childprocess-0.3.4/lib/childprocess/unix/fork_exec_process.rb:21:
warning: instance variable @cwd not initialized
If you want to temporarily suppress warnings you can try this:
From the look of it, webdriver is overwriting its own methods every time
you call a new process. There may be an alternative, but I’ve never
tried running synchronous instances of webdriver.
Because you haven’t assigned a value to @cwd, or its lost its value in
the current scope.
I have just invoked the code using a ruby script using system.
So what can I do to fix all these warning?
Or please help me with the way to supress all warnings.
Suppress stdout until the errors have passed, then restore it.
From the look of it, webdriver is overwriting its own methods every time
you call a new process. There may be an alternative, but I’ve never
tried running synchronous instances of webdriver.
I get these warning most probably because I run the script from another
script using ‘system’. Any clue? how to catch and rectify it?
This is outside my area of expertise, I don’t know enough about the way
‘system’ works with concurrent instances of webdriver. I think some
smaller-scale experimentation might the way to go with this; try to find
different ways of doing the same thing, or take a different approach
altogether.
If you want to temporarily suppress warnings you can try this: HOWTO redirect stdout in Ruby - Eddy Mulyono — LiveJournal
This is supressing stdout, not warnings only!!
From the look of it, webdriver is overwriting its own methods every time
you call a new process. There may be an alternative, but I’ve never
tried running synchronous instances of webdriver.
I get these warning most probably because I run the script from another
script using ‘system’. Any clue? how to catch and rectify it?
Suppress stdout until the errors have passed, then restore it.
Did not get you, kindly put some more light on it
Actually I just tried that, and webdriver seems to be ignoring the
console redirect, it’s still outputting to the console even when it
shouldn’t be.
This doesn’t work, although as far as I can see it should:
orig_std_out = STDOUT.clone #Make a record of the default console output
$stdout.reopen(“Rubylog.txt”, “w”) #Create / overwrite logfile
$stdout.sync = true #Allow interception of console output
$stderr.reopen($stdout) #Pass errors to logfile
require ‘watir-webdriver’
puts(‘goes to file’)
b = Watir::Browser.new #This generates a log from the driver
restore stdout
$stdout = orig_std_out
puts(‘goes to stdout’)
b.close
Suppress stdout until the errors have passed, then restore it.
Did not get you, kindly put some more light on it
From the look of it, webdriver is overwriting its own methods every time
you call a new process. There may be an alternative, but I’ve never
tried running synchronous instances of webdriver.
I get these warning most probably because I run the script from another
script using ‘system’. Any clue? how to catch and rectify it?
This is outside my area of expertise, I don’t know enough about the way
‘system’ works with concurrent instances of webdriver. I think some
smaller-scale experimentation might the way to go with this; try to find
different ways of doing the same thing, or take a different approach
altogether.
Yes thats what I was trying, and am trying, hope for the best. But there
should be logical reasons to solve it.
Suppress stdout until the errors have passed, then restore it.
Did not get you, kindly put some more light on it
Actually I just tried that, and webdriver seems to be ignoring the
console redirect, it’s still outputting to the console even when it
shouldn’t be.
This doesn’t work, although as far as I can see it should:
orig_std_out = STDOUT.clone #Make a record of the default console output
$stdout.reopen(“Rubylog.txt”, “w”) #Create / overwrite logfile
$stdout.sync = true #Allow interception of console output
$stderr.reopen($stdout) #Pass errors to logfile
require ‘watir-webdriver’
puts(‘goes to file’)
b = Watir::Browser.new #This generates a log from the driver
restore stdout
$stdout = orig_std_out
puts(‘goes to stdout’)
b.close
So basically we are taking warnings and redirecting it to some file
instead of stdout??? Am I correct?
But this solution is not satisfying, isnt it possible to really solve
warnings?
could you tell me the reason of these warnings?
Apart from webdriver’s warning there are warnings related to facter and
childprocess too.
I have no clue, where exactly am getting these warnings, its reason and
its solutions.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.