jaimin
November 21, 2017, 7:13am
1
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.
Sudeep
November 22, 2017, 5:47am
2
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.
Sudeep
November 22, 2017, 9:45am
4
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â
Sudeep
November 22, 2017, 11:34am
6
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
Sudeep
December 7, 2017, 6:07am
8
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 = Image.open("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))