title: How to access a SwiftUI view's property from a UI Test case class?
body: <p>I am writing UI tests and I need to access a view's @State properties, as long as a button inside this view.</p>
  
  <pre class="lang-swift prettyprint-override"><code>struct CircleImage: View {
  
      @State var imageName: String = ""
  
      var body: some View {
          // ...
          Button(action: {}) {}
          .accessibility(identifier: "myButton")
      }
  }
  </code></pre>
  
  <p>As is I easily get the button with <code>let myButton = app.buttons["myButton"]</code>. But for testing purposes I also need the access to the <code>imageName</code> property. I tried adding <code>CircleImage().accessibility(identifier: "circleImageView")</code> in the ContentView, but it overwrites all the accessibility(identifier: ) inside the CircleImage view (including the button).</p>