Open Hanifk2010 opened 3 years ago
I had the same issue and I solved it encoding the screenshoots in Base64:
windows.each do |window|
within_window window do
tmp_screenshot = page.save_screenshot(file_path)
screenshot = Base64.encode64(File.open(tmp_screenshot, "rb").read)
embed(screenshot, "image/png", "Screenshot")
end
end
I hope this help
Traceback (most recent call last): 16: from C:/xxxxxx/xxxxxxx/features/support/hooks.rb:115:in
block in <top (required)>' 15: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/report_builder-1.8/lib/report_builder.rb:76:in
build_report' 14: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/report_builder-1.8/lib/report_builder/builder.rb:41:inbuild_report' 13: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/report_builder-1.8/lib/report_builder/builder.rb:41:in
open' 12: from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/report_builder-1.8/lib/report_builder/builder.rb:42:inblock in build_report' 11: from C:/Ruby26-x64/lib/ruby/2.6.0/erb.rb:901:in
result' 10: from C:/Ruby26-x64/lib/ruby/2.6.0/erb.rb:901:ineval' 9: from (erb):12:in
block in build_report' 8: from C:/Ruby26-x64/lib/ruby/2.6.0/erb.rb:901:inresult' 7: from C:/Ruby26-x64/lib/ruby/2.6.0/erb.rb:901:in
eval' 6: from (erb):1:inblock in build_report' 5: from (erb):1:in
each_with_index' 4: from (erb):1:ineach' 3: from (erb):2:in
block (2 levels) in build_report' 2: from (erb):2:ineach_with_index' 1: from (erb):2:in
each' (erb):4:in `block (3 levels) in build_report': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)