Using sendKeys on remote IE-11 browser

You can correctly input text on remote IE-11 browsers in Automate through a custom BrowserStack capability.

Introduction

sendkeys() is a method in Selenium that allows you to type content automatically into an editable field while executing any tests.

Now, while running a Selenium test on IE11 locally or through a grid, you will sometimes face one or more of the following issues with the sendKeys Selenium command:

  1. IE Driver mistypes certain special characters
  2. Some characters are dropped from the input string
  3. The command execution is slow

(Refer to the GitHub Issue for more information.)

To solve all the above issues, BrowserStack has a custom capability as explained in the next section.

BrowserStack capability to solve sendKeys() issue in IE-11

BrowserStack provides a custom capability that fixes the issue with sendKeys on the IE-11 browser. If you use the below capability in your test script and then use the sendKeys command, then you will not experience the bug (as stated above) while running your tests on BrowserStack.

Capability Accepted Values Default
browserstack.sendKeys true, false false

Sample code to include the custom capability

The capability as shown below, needs to be declared along with all other capabilities like browser, os etc. at the start of the test script and you will still need to use the sendKeys command as you have been using, for entering keyboard inputs into an editable field. The code snippet below shows how to declare the browserstack.sendKeys capability at the start of your test script:

caps.setCapability("browserstack.sendKeys", "true");

capabilities['browserstack.sendKeys'] = 'true';
capability.SetCapability("browserstack.sendKeys", "true");
$caps['browserstack.sendKeys'] = "true";
caps["browserstack.sendKeys"] = "true"
caps["browserstack.sendKeys"] = "true"
my $capabilities = {
  "browserstack.sendKeys" => "true"
}

You can contact support if the browserstack.sendKeys capability does not resolve the issue with the sendKeys command in IE-11.

We're sorry to hear that. Please share your feedback so we can do better






Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback