Using Keyboard Key to send combined keys

Hello everyone,

I’m pretty new to Robot Framework (Browser Library) and I’m trying to find a way to send combined keyboard keys to the SUT without using a locator. I’ve searched for quite some time but can’t find the answer.

I want to use ‘Keyboard Key’ to send Shift + F5. I know with ‘Press Keys’ you can use + to chain combine modifiers with a single keypress (i.e. Control+Shift+T ) so I was hoping this also applied to ‘Keyboard Key’).

What I’ve tried so far:

  • Keyboard Key down Shift
    Keyboard Key press F5
  • Keyboard Key down Shift + F5
  • Keyboard Key down Shift+F5

Does anyone have a solution?

Thanks!
Milo

Hi Milo,

From the documentation for Keyboard Key it looks like you were nearly there, you just need to up the shift key:

  • Keyboard Key down Shift
    Keyboard Key press F5
    Keyboard Key up Shift

Alternatively with Press Keys you could try

  • The selector of None? (I don’t know if it will work but worth a try)
    Press Keys None Shift+F5
  • You could try sending the keystroke to the page using a selector like //html or //body
    Press Keys //html Shift+F5 or
    Press Keys //body Shift+F5

Hopefully one of those will work for you,

Dave.

Hi Dave,

Thanks a lot: it worked (first solution). Sorry it took me some time to respond: I was in the midst of moving. As soon as I can I’ll try the other solution as well.

Milo

1 Like