How to capture Default error message of Edit text box

I want to capture default error message of Edit text box.

I am using getText() method but can not capture that error message. I can not found the element id of the error message.

Is there any other way to capture this error message?

I want to Capture Email must be Valid error message from below screenshot.

Please find the below screenshot as reference.

Even I am facing the same issue. Unable to inspect element. Can anyone help?

can you do a driver.getPagesource() after this element is displayed.

I have tried the same. I used System.out.println(driver.getPageSource().contains("Minimum amount should "));

The value I received is False. I am working on a Native android application. I am not sure if page source should work for this.

for development EditText.setError() is implemented and the error message seems similar to the screenshot attached above.

why are you searching "Minimum amount should ", message says “Email must be valid”

This is the screen I am working on. It has the similar error message type as seen above in the screenshot

looks like you are getting a view on top of another view, however Appium is unable to recognise the new view.

You can also try using Appium desktop, to confirm.

1 Like

Yes I believe the same. Is there any way out to detect this error message and the text message present in it? Please let me know if anything can be done as UI automatorviewer does not detect it.

Hi Friends

R u able to handle this, Please reply if you had solution to handle this

use adb command for save a screenshot file. (I want remove blue cursor from .save_screenshot() )

os.system(“adb shell screencap -p /sdcard/screenshot.png”)
os.system(“adb pull /sdcard/screenshot.png screenshot.png”)

and use tesseract library for convert image to text

    pytesseract.pytesseract.tesseract_cmd = 'tesseract.exe'
    im ="screenshot.png")
    im3 = im.resize((x*3, y*3), Image.ANTIALIAS)
    im4 = im3.convert('L')
    text = pytesseract.image_to_string(im4)
    text=''.join(filter(lambda x: x in string.printable, text))

and assert
assert ‘True’==str(error1 in text))