cancel
Showing results for 
Search instead for 
Did you mean: 

How Can I turn off the Caps Lock before running my test script?

Highlighted
Contributor

How Can I turn off the Caps Lock before running my test script?

Hello Everyone!!

 

I need to know what I have to do to turns off the Caps Lock during  the execution of my Tests Script, so for I dont have any problems, this is because I use the keys  method to simulate keystroke but if The Caps Lock is turning On My test does not make the action that I programmed

 

I hope SomeBody Can help me to solve this situation

Thanks

4 REPLIES 4
Highlighted
Moderator

Re: How Can I turn off the Caps Lock before running my test script?

Hi jcruz,

 

TestComplete automatically turns off Caps Lock before test recording and test runs.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Contributor

Re: How Can I turn off the Caps Lock before running my test script?

In fact,I had already read that however Test Complete does not turn off the Caps I thought there was a configuration missing

Highlighted
Moderator

Re: How Can I turn off the Caps Lock before running my test script?

What makes you think TestComplete is not turning off Caps Lock? What actions is your test trying to perform, and what exactly does not work as expected?

Please provide more details - script code or keyboard test screenshots, error text from the test log, and so on.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Occasional Contributor

Re: How Can I turn off the Caps Lock before running my test script?

If bl is true then caps lock is on. the Keybd event will then turn it off, and the last call tests the keystate again to confirm its off.

 

bl = cBool(Win32API.GetKeyState(VK_CAPITAL))

If bl then

Call Win32API.keybd_event(VK_CAPITAL, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYDOWN, 0)

Call Win32API.keybd_event(VK_CAPITAL, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)

End if

bl = cBool(Win32API.GetKeyState(VK_CAPITAL))

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors