0

Can I click on NFC on/off button using robotium? I know NFC cannot be turned on/off programmatically unless the device is rooted. But if I raise a popup for the user to do so and then click on the on/off button.

Just wanted to know is it possible?

Dr.jacky
  • 3,341
  • 6
  • 53
  • 91
  • 1
    You are asking others to do a job for you. This will not go far here. We ware all busy. Have you tried? If not, just try it out. If it fails, update your question with more details on where it fails. – Christian Garbin Feb 09 '15 at 20:47
  • possible duplicate of [Android: Changing NFC settings (on/off) programmatically](http://stackoverflow.com/questions/5945100/android-changing-nfc-settings-on-off-programmatically) – user1251007 Feb 10 '15 at 00:28
  • @chr .......... Obviously i have tried and it did not work that is why i have asked the question. My intention was to ask am i trying to do things which are possible or not ? I got the appropriate solution from electric sunny and marked it as answer. You should have given answer instead of giving vague suggestions. – user2571691 Feb 11 '15 at 05:04

2 Answers2

0

No, it's not possible do it programmatically withour rootet device. You only can show nfc/wireless setting to user.

Android: Changing NFC settings (on/off) programmatically

Community
  • 1
  • 1
Dr.jacky
  • 3,341
  • 6
  • 53
  • 91
0

If I understand you correctly, you want to take the user to the NFC section of the Device Settings (via a Toast or something similar). If this is correct, then using Robotium you will be able to trigger and action the Toast, but once you are in the device settings, Robotium cannot make the actual selection.

Android Instrumentation actions are confined to a single package (the one under test).

Take a look at UIAutomater, this may help.

electricSunny
  • 3,229
  • 4
  • 19
  • 21
  • can i combine test cases of both uiautomator + robotium. So that i can enable NFC using uiautomator. Thanks in advance. – user2571691 Feb 09 '15 at 12:51