Appium test when changing sim card

Hello,
I’d like to test my app when switching sim card.

my app has 2 stages ,The first one is login process ,when it’s done I change sim card and the app changes screen to the 2nd stage.
when its changed to this screen I can work with the app, when switching back it does the same thing the other way around/

is there a way to test such scenario? (on a real device)

Thanks

You would probably need some type of robot to change the sim. You can take a look at tapster:

But it would take major modifications. Post here if you get something working!

@wreed
I’m sorry for not being clear enough.

I change the sim by myself , The only thing i’d like to do is to halt the app for 1-2 minutes then it will refresh to check whether the sim had been changed or not.

Ok, big fan of robots here, sorry if I jumped the gun. :smile:

So an easy way to stop your automation would be to sleep(60) or sleep(120). Then you change the sim & move on. I imagine that the app will automatically detect this?

A more subtle way would be to stop the client (but not the server), sleep as above, change the sim, start the client again (I think that would take care of refreshing the app) and move on with testing.

I’ve never tried anything like this but that would be the approach I take. If I found a way to detect the sim being changed out (I don’t know of a way to do this), I would try to use a wait.until(sim_card_changed) type of strategy.

Not sure if this could be the scenario you wish.
You can take a dual sim device, Keep one of the sim disabled before starting the app. Perform the action you want on app, go to settings disable the current sim and enable the other sim.
(assuming you are working with android device)