Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'watir-webdriver'
- profile = Selenium::WebDriver::Firefox::Profile.new
- profile.log_file = "/tmp/firefox.log"
- d = Watir::Browser.new :firefox, :profile => profile
- d.goto "data:text/html;content-type=utf-8,#{URI.encode DATA.read}"
- d.quit
- Dir['/tmp/firefox*.log'].each do |file|
- p :file => file, :has_client_error => File.read(file).include?('oops')
- end
- # output:
- #
- # {:file=>"/tmp/firefox-1.log", :has_client_error=>false}
- # {:file=>"/tmp/firefox.log", :has_client_error=>true}
- #
- __END__
- <html>
- <body>
- <script>
- throw new Error('oops');
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment