Is there any way to get user input in any field?

I have a scenario in which I’ll get OTP on the other cell phone and will automate AUT on another cell phone.
So, I need to input that OTP manually while automating that application. Any command or any idea to achieve this?

we have exactly same scenario in login to get SMS code.
With iOS client we can do this only from android phone (or by other method e.g. get it from server directly).

So in most cases we do it directly from server but few core cases we check that it 100% arriving to phone. The method we use is just same as open 2 appium drivers one for iOS simulator and another one for android phone. And when we need to get SMS we use Android functionality. For appium it is “driver.openNotifications();” - to drag notification down. Then just reading one by one all notifications we have and extracting sms code from it.

Hi @Aleksei,
My scenario is bit different. I have two android devices. I’m automating the application in one and OTP is receiving in the other, so I need to fill the OTP manually.

it is the same. we do automation with 2 android devices also (one sending request to another one. then second answer and so on). and from code point of view it is the same.

Can you give me some kind of example?
I have not performed this kind of scenario ever. So, it would be easy for me if you simplify the scenario.

  1. first start 2 appium servers with different port parameters. example of mine:
start appium as: [appium, --log-level, error, --port, 4725, --bootstrap-port, 5725, --command-timeout, 90, --session-override, --log-timestamp]
start appium_2 as: [appium, --log-level, error, --port, 4726, --bootstrap-port, 5726, --command-timeout, 90, --session-override]
  1. open 2 drivers when each one pointing to correct device. example of mine driver capabilites:
Capabilities [{app=/Users/jenkinss/Downloads/test_clients/xxxx.apk, noReset=false, clearSystemFiles=true, appWaitActivity=ee.xxxx.*, disableAndroidWatchers=true, version=, deviceName=LGH8155e9892e6, fullReset=true, platform=ANDROID, automationName=Appium, browserName=, autoGrantPermissions=true, udid=LGH8155e9892e6, platformName=Android}]

// second phone
Capabilities [{app=/Users/jenkinss/Downloads/test_clients/xxxx.apk, noReset=false, clearSystemFiles=true, appWaitActivity=ee.xxxx.*, disableAndroidWatchers=true, version=, deviceName=YT911B1KQX, fullReset=true, platform=ANDROID, automationName=Appium, browserName=, udid=YT911B1KQX, platformName=Android}]

// or in your case you can open directly sms messages on phone
Capabilities [{, noReset=true, clearSystemFiles=true, disableAndroidWatchers=true, version=, deviceName=005102d335df3d91, fullReset=false, platform=ANDROID, appActivity=.ui.ConversationListActivity, automationName=Appium, browserName=, udid=005102d335df3d91, platformName=Android}]
     open driver for ANDROID

now dow whatever you like.

I receive OTP in iOS and I read it directly from notification panel. With appium-xcuitest-driver we can see outside of our app in iOS also

@Telmo_Cardoso finally. Glad to hear. We do not use real devices for iOS (last time i tried with old automator).

Just wonder does XCUITest on real device same fast as in Simulator?

@Aleksei well, no :slight_smile: not even close

But I need to have real SIM card inserted on my app, I cannot use simulators/emulators :frowning: