appium: Performance degradation between Appium 1.4.13 and 1.6.0

The problem

We recently upgraded from Appium 1.4.13 to Appium 1.6.0. Following this upgrade we saw a huge performance hit in our tests to the point where individual actions (ex. element click) now take approximately 1500ms instead of 50msec which was the case with the previous version.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.6.0
  • Last Appium version that did not exhibit the issue (if applicable): 1.4.13 (although we have not tested with the versions in-between 1.4.13 and 1.6.0)
  • Desktop OS/version used to run Appium: OSX El Capitan
  • Node.js version (unless using Appium.app|exe): 4.6.0
  • Mobile platform/version under test: iOS 8.4
  • Real device or emulator/simulator: Emulator
  • Appium CLI or Appium.app|exe: CLI

Details

Our automated testing stack consists of Appium, Protractor and Cucumber. We recently upgraded from Appium 1.4.13 to 1.6.0 and found our tests becoming extremely slow. We have tested with a single Cucumber directive, which looks for an element, scrolls to it and clicks it, in order to try and identify the source of the problem, and it seems that every single action is taking around 1500msec instead of around 50msec which was the case with the earlier Appium version. More specifically, our Cucumber directive does the following (code included at the end of the issue):

  • Wait for an element to appear in the DOM
  • Check if the element is visible
  • Scroll to the element
  • Click the element

We are logging the time needed for each action to be performed and we are seeing the following times between Appium 1.4.13 and 1.6.0

  • Wait for element 78 msec with 1.4.13 vs 1542 msec with 1.6.0
  • Check if visible 40 msec with 1.4.13 vs 1552 msec with 1.6.0
  • Scroll 11 msec with 1.4.13 vs 515 msec with 1.6.0
  • Click 57 msec with 1.4.13 vs 1551 msec with 1.6.0

We have repeated our tests several times, and each time the results are similar. Unfortunately due to this delay we practically cannot run our tests, since they now need several hours to run instead of a few minutes, and since we need Appium 1.6.0 to support XCode 8 we are pretty much blocked. Please note that these results are with XCode 7 (since we needed to be able to compare the two Appium versions) but we are seeing a similar delay with XCode 8 (using iOS 10.0 and the XCUITest automation) as well.

Link to Appium logs

Code To Reproduce Issue [ Good To Have ]

The test Cucumber directive we are using:

this.When(/^I click "(.*)"$/, function(field, next) {
      var startTime = new Date().getTime();
       console.log(new Date());
      var scrollToScript = 'document.querySelector("' + selector.css(field)+ '").scrollIntoView();';
      this.helpers.waitUntilElementIsInDom(field, function (theElement) {
          var time1 = new Date().getTime() - startTime;
          console.log(time1);
          theElement.isDisplayed().then(function (isDisplayed) {
              var time2 = new Date().getTime() - startTime - time1;
              console.log(time2);
              browser.driver.executeScript(scrollToScript).then(function() {
                  var time3 = new Date().getTime() - startTime - time1 - time2;
                  console.log(time3);
                  theElement.click().then(function () {
                       var time4 = new Date().getTime() - startTime - time1 - time2 - time3;
                       console.log(time4);
                       next(); 
                  });
              });
          });
      });
  });

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 26 (8 by maintainers)

Most upvoted comments

it seem that performance issue is seen only on hybrid apps( using webview), might be helpful for fixing issue with performance.

Does Appium 1.6.2 contain fix for performance issue that is described in this ticket?