Closed mikepack closed 9 years ago
Selenium doesn't provide support for accessing console.logs.
console.log
One way around this would be to override console.log to call Teaspoon.hook, like this:
Teaspoon.hook
console.log = function() { Teaspoon.hook("log", {messages: arguments}); }
Calling console.log will call the hook defined in your teaspoon_env.rb, which could then print out the message:
teaspoon_env.rb
suite.hook :log do |payload| payload.messages.each do |message| puts message end end
Is that the solution or the question? I am facing the same problem.
Selenium doesn't provide support for accessing
console.log
s.One way around this would be to override
console.log
to callTeaspoon.hook
, like this:Calling
console.log
will call the hook defined in yourteaspoon_env.rb
, which could then print out the message: