Bug #15159
closedSome options of win32screenshot gem not working with Ruby 2.5.1.
Description
Hello,
The following options are not working for the win32screenshot gem (or possibly rautomation) in Ruby 2.5.1. The error I get is below. I have attached a log as well. The code works in Ruby 2.4.4.
C:/Selenium_Ruby/runtime/lib/ruby/gems/2.5.0/gems/rautomation-0.17.0/lib/rautomation/adapter/win_32/functions.rb:298: [BUG] Segmentation fault
Sample code...
filename_and_path="c:\myscreenshot.png"
puts "Attepting to take screenshot of foreground using Win32screenshot gem...\n\n"
Win32::Screenshot::Take.of(:foreground).write(filename_and_path)
puts "Attepting to take screenshot of window with title #{window_title} using Win32screenshot gem...\n\n"
Win32::Screenshot::Take.of(:window, :title => /#{window_title}/i).write(filename_and_path) #Another option
puts "Attepting to take screenshot of desktop using Win32screenshot gem...\n\n"
Win32::Screenshot::Take.of(:desktop).write(filename_and_path)
Files
Updated by jeremyevans0 (Jeremy Evans) almost 4 years ago
- Status changed from Open to Third Party's Issue
The segfault is in a external gem (rautomation) that uses FFI: https://github.com/jarmo/RAutomation/blob/7314a7e6f8bbba797d276ca1950abde0cba6897a/lib/rautomation/adapter/win_32/functions.rb#L18-L19
It looks very similar to a bug report on their bug tracker: https://github.com/jarmo/RAutomation/issues/122
Please work with the rautomation developers to resolve this issue.