Ask a Question

How do I simulate holding "UP" key

Alicya619
Occasional Contributor

How do I simulate holding "UP" key

Hello all,

 

I'm trying to simulate a press key continuously on "UP" keys but I expected to have the UP key press until it release (and so my value going up for several unit) but it's not the case, it's only one unit by one. I'm doing this :

 

Sys.Desktop.KeyDown(VK_UP);
aqUtils.Delay(TIMEOUT_DELAY, "Step 7 - Wait for 1.5s");
Sys.Desktop.KeyUp(VK_UP);

 

I have a look at these topics (not helpful):

- https://community.smartbear.com/t5/TestComplete-Desktop-Testing/Press-and-hold-2-keys/m-p/182354

- https://community.smartbear.com/t5/TestComplete-Desktop-Testing/How-do-I-simulate-holding-down-space....

 

I tried also to record the test, to use different objects, different application ... but nothing works.

 

Does someone have the answer :

- How to do it ?

- Why it's not working ?

 

Thank you in advance 

 

Alicya

11 REPLIES 11

Your "several" up presses isn't something that is measurable.  What are you going to compare it to in order to tell that the test has passed or failed?  


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
zarcher
Occasional Contributor

I would think in a testing or automation sense you would not want to leave this to chance and input the exact number of times up is hit. 

cancel
Showing results for 
Search instead for 
Did you mean: