I am testing a webapp that uses the key command of Fn + Command + M for macOS computers. How do I send the Fn key in Selenium WebDriver?

My first instinct was something like:

webElement.sendKeys(Keys.chord(Keys.FN, Keys.COMMAND, "m"))

However, there isn't a Keys.FN enum.

Since this is being used for RemoteWebDriver, using Java's Robot API is not an option.


I am afraid you can`t. As mentioned in the StackOverflow answers below, Fn keys are handled at hardware or driver level, so you cannot emulate them. Your best bet is to use some different key in place of Fn.

More information:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.