Send key F3 without input
See original GitHub issueI am newbie on cypress.
I need write a test with F3 send key to page.
I wrote this (114 = charcode key for F3):
cy.get('body').type('{114}') // (not ok)
cy.get('body').type('{{114}') // (not ok)
Pease help
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (1 by maintainers)
Top Results From Across the Web
How to Use Excel SendKeys Method in Macros - Contextures
The SendKeys method simulates keystrokes that you would manually input in the active window. Use with caution, because it can have unexpected ...
Read more >SendKeys statement (VBA) - Microsoft Learn
It uses the SendKeys statement to send keystrokes to add some numbers and then quit the Calculator. (To see the example, paste it...
Read more >Sending function keys (F1-F12) over SSH
Terminals only understand characters, not keys. ... Enter is Ctrl+M , Esc is Ctrl+[ ), function keys send escape sequences, beginning with ...
Read more >Send Key – Function 3 - Rocket Software
Meaning Mnemonic 3270 5250
@ @@ X
Alt @A X
Alternate cursor @$ X X
Read more >Function Send - AutoIt
Due to the send AutoIt implementation the CAPS LOCKed character will be sent as a Shifted character so it will not work. Certain...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The only special characters built in to Cypress are listed in the docs here. There is not a special character for
{114}
.You should be able to trigger the
keydown
event with the character code needed for F3 using.trigger()
like this:Let me know if this works.
I recently ran into a similar issue and came across this thread. In my case I had to trigger a Backspace. Unfortunately @jennifer-shehane 's suggestion didn’t work. I later learned that keyCode is deprecated in KeyboardEvent, but using key worked for me.
Here is my code:
cy.get('body').trigger("keydown", { key: "Backspace" });