Q. How do I check if the browser is visible?

A. Use the .visible method …
Example watir:

if @b.visible then
  puts "Browser IS visible"
else
  puts "Browser IS NOT visible"
end
Read More