-2

We have an internal website that has different users with different permissions and passwords and each has a button that copies the password to the clipboard so we can paste it into the login screen. Each button has an ID of AuserPwd, Buserpwed, Cuserpwd... I know how to get Selenium (Python) to click on that button, so that the password is in my clipboard, but how can I paste it into a different url password field. Basically, can I pass my clipboard to a variable and paste that variable into a field.

markiesm
  • 11
  • 2
  • 4
    Possible duplicate of [Paste command using Selenium](https://stackoverflow.com/questions/28637931/paste-command-using-selenium) – Reti43 Oct 18 '17 at 00:27

1 Answers1

-1

This is a simple workaround using xsel

    import subprocess
    print(subprocess.check_output(["xsel"])

Above code will give you the clipboard copied data,now using selenium just paste the data into the desired page.

vishalvvr
  • 82
  • 6