Appium Screenshots can't capture toast message in an Android native app -


i'm trying test appearance of toast message in android native app taking multiple screenshots after triggering message, , try extract message ocr. screenshots fail capture toast message if message observed on test phone during test.

in app toast message can triggered clicking on button. appears right after click , last 1 second. in code, see below, take screenshot right before click, , take screenshots after click every 200 ms 2 seconds. message can seen on test phone during test doesn't appear in screenshots. advice how happen , how can overcome this?

thanks!

rrhelper.takescreenshot(driver, "original"); driver.findelementbyid("no.ruter.reise.qa:id/search_button").click(); string namebase="toastdetect"; string name; for(short i=0; i<10; i++) {     name = namebase + short.tostring(i);     rrhelper.takescreenshot(driver, name);     thread.sleep(200); } 

my helper function taking screenshot:

public static void takescreenshot(androiddriver driver, string name) {     try {     file screenshot = driver.getscreenshotas(outputtype.file);     string filename = image_path + name + ".png";     fileutils.copyfile(screenshot, new file(filename));     } catch (exception e) {         system.out.println("exception while saving file " + e); } 


Comments