IE webdriver cannot type @

My test step setText keeps failing on internet explorer, but works on others

WebUI.setText(findTestObject(‘EXTERNAL/inputs/input_requestoremail’), ‘test@test.cz’) ← Ends up with typing 'testvtest.cz on IE, ends up normally on other browsers

I tried updating webdrivers myself, still cannot get it to work.

I tried using sendKeys, but that doesnt work either.

Okay, so i fixed it by making a little workaround.

I have made a JavaScript button that copies the email adress to my clipboard and pasted it with sendKeys SHIFT+INSERT, because ctrl + v didnt work.

Hope you can fix it this way too, if you came across this problem.

1 Like

replace @ with Keys.chord(Keys.CONTROL, Keys.ALT,‘2’)

In your case :

WebUI.setText(findTestObject(‘EXTERNAL/inputs/input_requestoremail’), ‘test’ +Keys.chord(Keys.CONTROL, Keys.ALT,‘2’) + ‘test.cz’

3 Likes

Federico Jimenez said:

replace @ with Keys.chord(Keys.CONTROL, Keys.ALT,‘2’)

In your case :

WebUI.setText(findTestObject(‘EXTERNAL/inputs/input_requestoremail’), ‘test’ +Keys.chord(Keys.CONTROL, Keys.ALT,‘2’) + ‘test.cz’

The suggested solution is not independent of the keyboard layout set on the executing system.
For instance, on a German keyboard layout you would need

Keys.chord(Keys.CONTROL, Keys.ALT, 'q')

On a French keyboard layout you would need

Keys.chord(Keys.CONTROL, Keys.ALT, '0')

and so on…

This will be a problem when you are going to execute tests on a remote host where you

  • cannot set the keyboard layout to a specific one
  • do not know the keyboard layout set on the remote system

The underlying problem has been addressed in a recent IEDriver release (see GitHub issue #4523). For a correct solution without (partially working) workarounds we have to wait for a Katalon release that includes the latest IEDriver release.

2 Likes

Found a little workaround with Javascript:

WebElement element = WebUiCommonHelper.findWebElement(findTestObject('YourObject'), 30)
WebUI.executeJavaScript('arguments[0].value = "test@test.com"', Arrays.asList(element))

It seems to be working, but sometimes input won’t react with this value. In this case i recommend this:

WebElement element = WebUiCommonHelper.findWebElement(findTestObject('YourObject'), 30)
WebUI.executeJavaScript('arguments[0].value = "test@test.comm"', Arrays.asList(element))WebUI.sendKeys(findTestObject('YourObject'), Keys.chord(Keys.BACK_SPACE))

Third line of code is for simulating user action. It will delete one additional character in e-mail address (line 2). After this, value set by javascript will be taken as valid.

1 Like

The solution works for IE but the script does not work anymore for other browsers e.g. chrome. When can we expect a new katalon release with a fix?

thanks!

On a French keyboard layout you would need

Keys.chord(Keys.CONTROL, Keys.ALT, '0')

Keys.chord(Keys.CONTROL, Keys.ALT, ‘à’) works for me