title: Appium and Ruby: iOS tests runs v. slow - switch xpath search strategy to something else
body: <p>For appium, my iOS tests are running pretty slow. I thought this was an issue with instruments-without-delay. I have followed guides online to get iwd to work(e.g. changing plist etc) but tests are still slow so I'm not sure if iwd is the issue. One suggestion I found was to not use xpath locator strategies but I'm not sure how I would change them to not use xpath. The locator code is:</p>
  
  <pre><code># Search by name or exact text.
  value = '//*[@name="' + element_name + '"]'
  elements = $driver.find_elements(:xpath, value)
  
  # Search for element containing the text "element_name". Uses xpath.
  # iOS searches by name, Android by text.
  is_iphone ? (xpath = '//*[contains(@name, "' + element_name + '")]') : (xpath = '//*[contains(@text, "' + element_name + '")]')
  </code></pre>
  
  <p>Is there a way to search for the name/text/label of an element without using xpath? (Especially since appium doesn't support locator strategy by name).</p>
  
  <p>Similarly, is there anything else I can do to speed up the tests? </p>
  
  <p>I am running this on iOS 9.3 simulator and xcode 7.</p>