Using the Clipboard to insert text

Watch this video to learn how to use the SetClipboard and the Stopwatch building blocks.

What you learn in this lesson

  • How to use the SetClipboard building block.
  • How to add text to your application at 4 different speeds.
  • How to use the Stopwatch to measure the time between different building blocks.

Lesson Overview

Watch this video to learn how to use the SetClipboard and the Stopwatch building blocks.

What you learn in this lesson

  • How to use the SetClipboard building block.
  • How to add text to your application at 4 different speeds.
  • How to use the Stopwatch to measure the time between different building blocks.

In this video I will do a small demonstration of how to use the Set Clipboard building block.

 

When you use the Set Clipboard block you can input text to the block, and when the building block is executed as part of a workflow, it will add the text to the clipboard on the agent machine.

Once it’s on the clipboard you can use Type Text or similar operations to get the content into the application you are automating.

In this example I’ll use the Set Clipboard to optimize the time it will take to enter a URL into the address field in a browser. Once your case is designed and is running there is no need to spend a lot of time in the workflow, waiting for a Type Text building block to enter a long URL.

I’ll start by showing you how you can use the Type Text building block, and then I’ll show the alternative solution with the Set Clipboard.

I’m also gonna use the Stopwatch building block to measure the differences in time using Type Text compared to using the clipboard.

I have prepared a couple of building block in advance. A Type Text building block that will set focus in the address field of an open Chrome browser, by sending CTRL+L to the browser. This block has nothing to do with the actual test.

Next I have a Set Text building block that will contain the URL to enter.

First I’m gonna add a Stopwatch building block.

  • Add Stopwatch

This building block will start a timer when it’s executed in the workflow. In this case right before we start to type text into the address field. Using the elapsed property on the stopwatch, will give us the time that has elapsed, since the stopwatch was started.

The next building block is a Type Text.

  • Add Type Text

I’ll wire the Set Text with a new field in the Type Text block and use this in the text value.

  • Wire up Set Text and new field in Type Text
  • Compose message in Type Text

I will use a Log Message building block to log the time from when the typing starts to its end.

  • Add Log Message
  • Wire up StopWatch to Log Message.

Let’s run the case

  • Run case

So with the default Type Text speed it takes around 4,5 second to enter this URL. It’s probably the same time a normal user would use the enter this URL.

  • Enable Edit mode

I’ll will change the “Key speed” in the Type Text to “Fast” and rerun the case.

  • Change Key Speed
  • Run case

So, much faster. Around half a second to enter the URL.

Let’s try to use the Set Clipboard.

  • Enable Edit mode

I’ll add a Set Clipboard right after the stopwatch.

  • Add Set Clipboard

Then I’ll add the URL to the clipboard, and change the Type Text to send CTRL+V instead of the URL.

Let’s run the case.

  • Run case

So this was VERY fast. I guess around 20-25 times faster than using the fastest Type Text.

So in this video I have given one example of how to use the Set Clipboard in a flow and shown that it can be used to optimize the time it takes to enter text in some scenarios.