Forum Xamarin Test Cloud (Read Only)

Setting AccessibilityIdentifier on a UILabel and UIButton fails to show in REPL

CaptainXamtasticCaptainXamtastic GBUniversity ✭✭✭

I have successfully set an Accessibility identifier for a UIButton (a custom button that inherits from UIButton), and it shows up in the REPL, however setting it on a another UIButton (another custom button that inherits from UIButton), and also a UILabel fails to show in the REPL.

The accessibility identifiers are set together in the same MvxViewController:

btnLogin.AccessibilityIdentifier = "StartScreenView_LoginButton";  // Secondary button which inherits from UIButton
btnSetup.AccessibilityIdentifier = "StartScreenView_SetupButton"; // Primary button which inherits from UIButton
versionLabel.AccessibilityIdentifier = "StartScreenView_VersionNumberTextView"; // UILabel

results in the following in the REPL:


You can see that the first button shows an id of "StartScreenView_LoginButton".

However the UILabel that has the following does not show the expected id:

[UILabel] label: "2.4.0 (1)", text: "2.4.0 (1)"

Nor does the other button show an id:

[SecondaryButton] id: "StartScreenView_LoginButton",  label: "Already have an account"
      [UIButtonLabel] label: "Already have an account",  text: "Already have an account"

Any ideas?

My Xamarin.UITest package has a version of 2.1.3.

It's in a Xamarin.iOS project.

Kind regards,

Anthony

Best Answer

  • CaptainXamtasticCaptainXamtastic GBUniversity ✭✭✭
    Accepted Answer

    Fixed it.

    I changed the path to the app instead of just referring to the bundle id, vis-a-vis:

    ConfigureApp
                    .iOS
                    .AppBundle("../../../myprojectname/bin/iPhoneSimulator/Debug/myproject.app")
                    .Debug()
                    .PreferIdeSettings()
                    //.InstalledApp("My bundle id")
                    .StartApp()
    

    As it turned out the later was referring to a different build.

    But here are the results for posterity:


Answers

  • CaptainXamtasticCaptainXamtastic GBUniversity ✭✭✭
    Accepted Answer

    Fixed it.

    I changed the path to the app instead of just referring to the bundle id, vis-a-vis:

    ConfigureApp
                    .iOS
                    .AppBundle("../../../myprojectname/bin/iPhoneSimulator/Debug/myproject.app")
                    .Debug()
                    .PreferIdeSettings()
                    //.InstalledApp("My bundle id")
                    .StartApp()
    

    As it turned out the later was referring to a different build.

    But here are the results for posterity:


Sign In or Register to comment.