Search sendkeys Keys.chord(Keys.ENTER) return null

Hello Expert,

I want to ask your help with the issue I have been encountered in searching results showing like null value. Previously the searching automation is working fine and suddenly after months, the issue occurs. Below screenshot for reference. Thanks

WebUI.setText(findTestObject(‘Object Repository/Mail/Search_button’), Email)
WebUI.sendKeys(findTestObject(‘Object Repository/Mail/Search_button’), Keys.chord(Keys.ENTER))

Did you just change Chrome browser version?

chrome 98
Chrome browser version

Did you try updating the driver?

image

@Russ_Thomas yea I’ve tried to update the chrome web driver and still the issue exists.

You can try:

WebUI.sendKeys(findTestObject(‘Object Repository/Mail/Search_button’), Keys.ENTER.toString())

Or waiting for the fix of Chrome on Feb 16. Please refer to the related thread:

@duyluong Great, it’s working using the “Keys.ENTER.toString()”. Thank you so much. :heart: :clap:

1 Like

Hi, im getting a chinese caracter when i used this funtion. please help

AndroidDriver<?> driver = MobileDriverFactory.getDriver()

def texto = ‘Introducir número de documento’

MobileElement Element = driver.findElement(By.xpath((((‘//*[@class = 'android.widget.EditText' and (@text = '’ + texto) +
‘' or . = '’) + texto) + ‘')]’))

//Element.sendKeys(Keys.chord(Keys.ENTER.toString()))

Element.sendKeys(Keys.RETURN.toString())

RESULT

@vgomez You really should open your own question on this forum for this. Your question is to do with Mobile, whereas this one is about Web. And this question already has a solution.

And, if I were you, I would try to reduce the number of parentheses on the below statement. I think the parentheses do not look right.

MobileElement Element = driver.findElement(By.xpath(((('//*[@class = 'android.widget.EditText' and (@text = '’ + texto) + ‘' or . = '’) + texto) + ‘')]'))

Maybe like:

MobileElement Element = driver.findElement(By.xpath("//*[@class = 'android.widget.EditText' and (@text = '${texto}' or . = '${texto}')]")