[How to] Read SMS from native messaging app (p.e. to read OTP)

Is it workable for IOS or only Android

You have an alternative for Android and other for Android, read post :slight_smile:

1 Like

http://www.droidbin.com/p1ajnc11sp13o3gd21cdi1un3dlh3 link return 404 :sweat:

link is also broken with 404 “An error has been encountered in accessing this page.” :frowning:

Thanks @KatzBo for letting me know.

I’m not 100% sure of my original code :slight_smile: but I re-uploaded the code and APK on new links

are the links useable?
I read alot of your replys about the OTP sms test …
Can you suggest me what is the best way to check an OTP sms msgs?

I am testing Android with Java using Eclipse …

Follow tutorial and yes, links are usable now

1 Like

@Telmo_Cardoso
could you kindly upload SMSPopup.apk to a free download site? for apkshared site have to be signup with your credit card information, could you upload the APK file to for example google drive?
thanks.

Hi,

changed the link. Please be aware that I have no rights over that app and it is just a random app that I downloaded from the store.

Thanks for the hint

@Telmo_Cardoso
thanks for your work, and note the right of the app, I think all guys of Appium just use it in test only purpose.

“SMS ON IOS” does not seems to work anymore.
Appium ver: 1.6.4 (appium desktop 1.0.2-beta.2)
iPhone 6 IOS 10.3.2

Hi @NirBY

the section “For iOS” was prepared for UIAutomation.

I guess you are using XCUITest with those versions. For XCUITest I can read outside of app I’m testing, so I just open notification panel and read SMS directly from there.

Hi Telmo
For XCUITest when I open notification panel to read SMS directly from there
the appium logs send error:

[debug] [XCUITest] Connection to WDA timed out

[debug] [iProxy] recv failed: Operation not permitted

I can not find msg locator
when I close notification WDA return to work

Hey,
I tried this but getting an error. I have already installed the App and configured to “Accept”. So have commented out the code.

ExtractCode eCode = new ExtractCode(driver);
//eCode.installSMSAPK();
// eCode.configureSMSAPK();
String mySMS = eCode.returnSMS();
// eCode.uninstallSMSAPK();
System.out.println(mySMS);

I am getting the error: ava.lang.Exception: The following id was not found: net.everythingandroid.smspopup:id/popupMessageMainlayout
But i see the pop on the mobile phone running the case.

I had opened a WebApp which sent an sms and I am trying to read it.
Do i need to explicitly pass control to this pop? How?
If not, what can be wrong. Please help.

automate it like its your app… open inspector you prefer, see elements and try to found them in debug mode.

I am using the same smspopup app from playstore which you had used. It throws me the following error:
java.lang.Exception: The following id was not found: net.everythingandroid.smspopup:id/popupMessageMainlayout

while uiinspectorviewer shows me that this is present.

Try to inspect in debug mode directly from your IDE. If its present on uiautomatorviewer, it should appear also during automation.

I think I am not able to switch from my webApp to this view. Donno how to do it.

Will you explain little more about this line
Drivers.getDriver(device)
Because I am new to automation testing
Please help