4

I'm using Chrome Headless for testing purpose. It is used in conjunction with nightwatch.

There is an action that clicks on a button in a page. Unfortunatly the page is not online, but the copy part is done with export:

this.waitForElementVisible('@exportBtn', 6000)
                .click('@exportBtn')

This button, using javascript, it copy some content in the clipboard.

[EDITED] The button uses ngclipboard from Angular (https://sachinchoolur.github.io/ngclipboard/)

But when I "paste" the content in another field, the content is not the one copied/expected. The paste is done with:

client.keys([client.Keys.CONTROL, "v"]);

Running the same test in the normal way (Chrome with the UI) there is no error.

For your info: the paste part works, in the sense that it paste something in the text field, but it's not the one copied, it's the last thing copied by myself (from notepad, from word...from everything but outside and before the run of this test)

Any clue or possible error?

Miro Barsocchi
  • 343
  • 1
  • 3
  • 15
  • 1
    Could you please share an [mcve]? – Jeroen Sep 13 '17 at 10:03
  • 1
    Saw your edits, they do clarify some stuff. I think the important missing detail is the code that copies content to the clipboard. We'd need _at least_ that to repro your scenario. Could you provide a minimal version of your html/js? – Jeroen Sep 13 '17 at 11:30
  • Added and edited the way the button behaves. It uses Angular function ngclipboard – Miro Barsocchi Sep 13 '17 at 12:26
  • 1
    By the way, we do have the same problem and this behaviour only happens on a windows environment (in our case the build server). Our developers works on macs and the copy/paste done this way works well even in headless. – S.Galarneau Jan 05 '18 at 18:59
  • 1
    I think this is a bug coming from the chrome webdriver – S.Galarneau Jan 05 '18 at 19:00

0 Answers0