TestProject Forum
Powered by leading experts in the test automation community

Copy and Paste a value?

Hi all,

I have searched the forums but cannot find and answer to this.

Is there any way I can copy a value in my process, then paste it at the end?

The app I am working on requires a token to be entered at the end of the process.

I want to be able to copy that value, then paste it in later on. Is this possible? Ctrl-C and Ctrl-V does not seem to work?

Hi Oliver, thanks for reaching out.
You can do the following:

  1. Select the element you want to copy the text from( the token ).
  2. Create the step “Press and hold” and give it the ELFT_CNTROL value.
  3. Create the step “Type text” and and give it the value of ‘a’
  4. Create another step to hold LEFT_CONTROL, after create the same step as 4 but give it the value ‘c’ this time.
  5. Release the LEFT CONTROL key

Now it is copied ,when you reach where you want to paste, do the same thing.
Select the element, hold LEFT_CONTROL, use type text and send the value ‘v’ and release LEFT_CONTROL.

Full example of steps:
image

Best Regards, Ran.

Oh wow! I didn’t think of doing it like that!

I’ll give it a try! Thanks a lot!

Small correction, you need to hold LEFT_CONTROL again before typing ‘c’
image

You are very welcome :slight_smile:

I wasn’t able to find the “Press and hold” action, but I did find the “Press Android Key” action.

This seems much simpler. Install this action and you can simply use “COPY” for the key to copy and “PASTE” for the key to paste.

Here’s a list of all of the keys available: https://appium.github.io/java-client/io/appium/java_client/android/nativekey/AndroidKey.html#PASTE

Thanks @sean.mcavoy, that is the way for android and indeed it is simpler.
what I have suggested is for web only.