What are small hacks to run your appium tests faster?

  • minimize Xpath usage. search elements by Id(Android) or AccessibilityID(iOS).
  • minimize use of “verify X element NOT FOUND” or if it is really needed set min timeout for this operation
  • iOS: do test on simulator (4 times faster any real device. NOT valid any more in 2020)
  • Android: do test with real device (faster even Genymotion)
  • use different strategy to load driver for testcases when needed client reset and not (no-reset flag). consider mostly use cases when no reset needed (starting faster)
  • consider add variable when any similar operation needed e.g.: log el_1 text, check el_1 text is not empty, check el_1 text contains something, check el_1 text size is another something ->replace with-> String tmp = el_1 and compare later only “tmp”.
  • use Google pageObjects ( https://code.google.com/p/selenium/wiki/PageObjects ) + FindBy ( example: https://github.com/appium/java-client/blob/master/src/test/java/io/appium/java_client/pagefactory_tests/AndroidPageObjectTest.java)
8 Likes