cancel
Showing results for 
Search instead for 
Did you mean: 

Use Key Method to Press arrow-key-down for a certain time

SOLVED
Occasional Contributor

Use Key Method to Press arrow-key-down for a certain time

When the arrow-key-down button is pressed, this mapped object in my winform app will display a 'dropdown' panel, 

 

Currently , it's neccessary that I use method .Keys('[Down]') on this object search_bar  to stimulate the visibility/appearence of the 'dropdown' panel 

            self.search_bar .Keys('[Down]')  
The panel does show up, however just for 1 second or so.

I need to make the 'dropdown' panel stayed for a longer time-frame, i.e. 50 seconds

How can I make the .Keys('[Down]') stay longer than 1 second as it would normally does.


self.search_bar = Aliases.SomeAppClient.Console.Streaming.Tabs.XyxStage.AbcSearchBar

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Manager

Re: Use Key Method to Press arrow-key-down for a certain time

Hi @HKTCentrix, since none of the suggestions helped, I am assuming your situation might require deeper investigation from our side.

Please contact the SmartBear Support Team and describe the issue you are facing in detail. Thank you! 



Sonya Mihaljova
Community and Education Specialist

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!

View solution in original post

6 REPLIES 6
Highlighted
Occasional Contributor

Re: Use Key Method to Press arrow-key-down for a certain time

I have tried using the timer

start_time = time.time()
while (time.time() - start_time < hold_time) :
         self.search_bar.Keys('[Down]')
############################

Also, have tried this suggested somewhere in the forum:

self.search_bar.SetFocus()
self.search_bar.Keys('[Down]')
Sys.Desktop.KeyDown(Win32API.VK_CONTROL);
Delay(50000);
Sys.Desktop.KeyUp(Win32API.VK_CONTROL); 

Nothing has worked! 



Highlighted
Community Hero

Re: Use Key Method to Press arrow-key-down for a certain time

You might look into https://support.smartbear.com/testcomplete/docs/reference/project-objects/items/llp/llplayer/index.h...


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
Highlighted
Community Hero

Re: Use Key Method to Press arrow-key-down for a certain time

Do you need to have it HOLD the down key for a time?

 

If that's the case, there is a "HOLD" keyword in the "Keys" method that will allow you to hold a set of keys down until you release.

So, Keys('[Hold][Down]a[ReleaseLast]') will hold the down arrow and then tap the a key and then relase the down arrow.

 

Will this work for you?


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

Re: Use Key Method to Press arrow-key-down for a certain time

LLPlayer Object does not work for me.

 

sDelay = 20000
self.search_bar.SetFocus()
self.search_bar.Keys('[Down]')
LLPlayer.KeyDown(VK_DOWN, sDelay); # (1)
self.search_bar.Keys('[Down]')
LLPlayer.KeyUp(VK_DOWN, sDelay); # (2)

Thrown in several lines of codes, with different orders of lines, and none of them make any difference.

All I got is " Waiting for a delay between low-level events" when line 1 and 2 got hit

 

Highlighted
Occasional Contributor

Re: Use Key Method to Press arrow-key-down for a certain time

No, this does not work for me either. The effect is the same as .Keys('[Down]')

 

self.stage_search.Keys('[Hold][Down][ReleaseLast]')

 

the letter a trick didn't work either.

self.stage_search.Keys('[Hold][Down]a[ReleaseLast]')

 

 

 

 

Highlighted
Community Manager

Re: Use Key Method to Press arrow-key-down for a certain time

Hi @HKTCentrix, since none of the suggestions helped, I am assuming your situation might require deeper investigation from our side.

Please contact the SmartBear Support Team and describe the issue you are facing in detail. Thank you! 



Sonya Mihaljova
Community and Education Specialist

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!

View solution in original post