title: How to click into toggle button using appium and java?
body: <p>I'm using java with TestNG Framework with Appium to test a site on safari browser in Ipad simulator , i want to know how to identify toggle button and to make it ON / OFF.</p>
  
  <p>Here Html code : </p>
  
  <pre><code>  &lt;md-switch aria-label="alertToMail" ng-model="mail" class="ticket-switch ng-pristine ng-untouched ng-valid ng-empty" role="checkbox" tabindex="0" aria-checked="false" aria-invalid="false" style=""&gt;&lt;div class="md-container"&gt;&lt;div class="md-bar"&gt;&lt;/div&gt;&lt;div class="md-thumb-container"&gt;&lt;div class="md-thumb md-ink-ripple" md-ink-ripple="" md-ink-ripple-checkbox=""&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div ng-transclude="" class="md-label"&gt; &lt;/div&gt;&lt;/md-switch&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/ZPmi7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZPmi7.png" alt="toggle"></a></p>