Forum Xamarin Test Cloud (Read Only)

AccessibilityIdentifier not working on real devices

Hi

https://developer.xamarin.com/recipes/testcloud/set-accessibilityidentifier-ios/

I'm able to run ui tests on iOS simulators using accessibilityidentifiers to tap, enter text etc

On real devices when I type "tree" on the terminal..there's no accessibilityidentifiers id's. Is there anything I need to change on my project or is this normal?

Best Answer

Answers

  • Glenn.WilsonGlenn.Wilson USXamarin Team Xamurai

    @Nuninz No, that is not normal. How are you building the app and setting the ids?
    Can you post the tree commands from a device and simulator?

  • NuninzNuninz USMember ✭✭
    edited March 2016

    it seems to be working now..I think I had a release version on the device. I rebuild everything and installed the debug one on the device and I can see the tests run just fine. One question..on the simulator, before each test, the app seems to be reinstalled which is quite useful in my case but on the real device it doesn't seem to reinstall the app. It just runs the current one. Is this a feature just for simulators?

    this is what I'm using to "return" the app:

    return ConfigureApp.iOS.StartApp();

    and before each test:

      [SetUp]
      public void BeforeEachTest ()
      {
          app = AppInitializer.StartApp (platform);
      }
    
  • NuninzNuninz USMember ✭✭
    edited March 2016

    thank you @Glenn.Wilson ! Are you aware of any plans to support that parameter in physical iOS devices? I've started writing tests based on the app starting for the first time for every test.

    Another question. Since this parameter is not supported..how can I make a call to my code from the UITest project? I have static references to some classes where I can do the clean up that I need(logout, clear local content, cache, etc). I can use those static references just fine on my iOS project, but on the UITest project all those references are null.

  • Glenn.WilsonGlenn.Wilson USXamarin Team Xamurai

    @Nuninz

    You can use backdoors to access functionality in your app from UITest. See: Backdoors.

  • NuninzNuninz USMember ✭✭

    thank you very much!

Sign In or Register to comment.