Michal Štefan
Katalon Apprentice
01/02/2018

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. 


Tagged:
Upvote
Quote

Comments

  • tester max
    Katalon Apprentice
    07/31/2018
    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.

    Best Answer
    Upvote
    Quote
  • Michal Štefan
    Katalon Apprentice
    01/09/2018
    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.
    Upvote
    Quote
  • Federico Jimenez
    Katalon Apprentice
    06/07/2018
    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'


    Upvote
    Quote
  • Kai Stempfle
    Katalon Apprentice
    07/06/2018
    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.
    Upvote
    Quote
  • Nidhi Khetawat
    Katalon Apprentice
    08/09/2018
    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!
    Upvote
    Quote
Sign In or Register to comment.
Not the answer you're looking for? Consider subscribing to Business support.