clipboard
                                
                                
                                
                                    clipboard copied to clipboard
                            
                            
                            
                        Cannot use Clipboard on Browserstack and/or headless automation tests
I'm trying to use Clipboard on my automated tests. I'm clicking a button that copies text to clipboard but it's not working when I ran the tests on Browserstack and/or when I ran the tests headless! It keeps getting my system clipboard instead.
Hi @celonicolosi,
could you provide some more info, like what goes into the clipboard, and what is expected to be returned?
@janlelis I can show you such a test: https://github.com/selenide-examples/selenide-browserstack/blob/main/src/test/java/org/selenide/bs/ClipboardTest.java
This test
- clicks a button (on a web page) that copies some text to a clipboard,
 - verifies that clipboard contains the expected text.
 
The problem is that
- step 1 operates with clipboard on remote machine (where BrowserStack browser is running), but
 - step 2 operates with local clipboard (where the test is running).
 
To make it possible, you should create some API in BrowserStack that would give access to clipboard on the "browser" machine. Look how it's done in Selenoid: https://github.com/aerokube/selenoid/blob/master/docs/clipboard.adoc
Although I am not sure if this in the scope or responsibility of this gem, it would be great if there is an easy-to-use way to do clipboard-tests in your CI. Did someone get this right, maybe with the described solution in @asolntsev comment?