OpenQA.Selenium.WebDriverException: 'unknown e

2020-02-16 02:25发布

I am trying to sendkeys a emoji.I have tried to send it by coping the signal

1条回答
ゆ 、 Hurt°
2楼-- · 2020-02-16 02:43

This error message...

OpenQA.Selenium.WebDriverException: 'unknown error: ChromeDriver only supports characters in the BMP

...implies that the ChromeDriver was unable to send the emoji i.e. ?? signal through SendKeys() method.

Taking out a leaf from @JimEvans answer, currently ChromeDriver only supports code points in the Plane 0 i.e. the Basic Multilingual Plane (BMP) at present.

Using GeckoDriver/Firefox or IEDriverServer/IE combo would have fetched you better results.

You can find the current status of the specific tests in the Web Platform Test Suite that specifically send emojis and these work for other browsers too.

However, to send a emoji through C# you can use the following syntax:

input.SendKeys("\u1F44D");
查看更多
登录 后发表回答