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
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
Solved! Go to Solution.
I have tried using the timer
start_time = time.time()
while (time.time() - start_time < hold_time) :
Also, have tried this suggested somewhere in the forum:
Nothing has worked!
Click the Accept as Solution button if my answer has helped
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?
[Hall of Fame]
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
LLPlayer Object does not work for me.
sDelay = 20000
LLPlayer.KeyDown(VK_DOWN, sDelay); # (1)
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
No, this does not work for me either. The effect is the same as .Keys('[Down]')
the letter a trick didn't work either.