Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use Clipboard on Browserstack and/or headless automation tests #40

Open
celonicolosi opened this issue Oct 21, 2020 · 3 comments
Labels

Comments

@celonicolosi
Copy link

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.

@janlelis
Copy link
Owner

Hi @celonicolosi,

could you provide some more info, like what goes into the clipboard, and what is expected to be returned?

@asolntsev
Copy link

@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

  1. clicks a button (on a web page) that copies some text to a clipboard,
  2. 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

@janlelis
Copy link
Owner

janlelis commented Apr 4, 2024

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?

@janlelis janlelis added the Docs label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants