In this video, I'm going to be showing you how we can send special key sequences to an application in 2 Steps. And this allows us to do things like control+alt+delete in Windows, or perform an undo operation with control+z. It's also really helpful to scrolling web pages using the page down key rather than having to drag the scroll bar, which can be tricky to get right when you don't have instantaneous visual feedback. So I've loaded up a test I made earlier in which I've made a little drawing in an online paint app. I mean, I run that now and fast forward to the execution of the test.
So this is my final work of art. And I now am going to send a couple of control+z key sequences to the app to undo the last two paint operations. So I right-click in the main test window. And then I click on send special case and here we have available all the keys on a standard keyboard. I can compose my key sequence by clicking on the buttons I want. So I click control annual suit. Two pills appear in the input area. The first is for the key down the action. And the second is for the key up action now, because control is a modifier key, the flashing cursors in the middle of the two pills. So when I click the Z key, or I can just type it directly on the keyboard, the two pills for the Z keypress appear between the two control pills. So I can read this sequence as press control, press Z, release Z and, release control.
You'll notice that right now where I've got the cursor in between the Z and the control, that the Z and the control buttons are disabled. That's because you can't obviously have the same key held down twice, but I can use the cursor keys to move around inside this input. And then I can enter a second control+Z sequence here. Okay. So that's two, undos. That's what I want. So I'm going to click, okay. And you'll see straight away that the undo commands have been sent to the application. Now you can use this technique to compose any key sequence you can imagine. So this makes it a very powerful tool. However, you should note that no images are captured when you use this command. So it's a good idea to put a wait for image command afterwards, to ensure the application is how you expect it to be when the test is run later by the scheduler. So the last thing I'm going to do here is just capture this image and I'll just give it a name and say wait for the image here, click okay. And there we go. So that's how we create command key sequences in 2 Steps. Thanks for watching.