The ruby code is running in Linux machine and the test browser is running in the windows(node) machine.
And in the webpage, I am selecting a content and doing ctrl+c(keyboard action)
So, the content being copied to windows machines clipboard.
How do I access the windows clipboard content using ruby?
driver.action.key_down(:control)
.send_keys('c')
.key_up(:control)
.perform
File.open(windows_text_file_path, 'w+') { |file| file.write(Clipboard.paste) }
I have used the Clipboard
method, but it is returning the linux machines clipboard contents.
Note: I have tried pasting the clipboard content into windows/linux shared folder, to check whether it is accessible, but the same error.