Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-12501

Don't use XPath selectors in Camera Appium tests for Android

    XMLWordPrintableJSON

Details

    Description

      Currently Appium tests use XPath selectors, which are sloppy and buggy. For example, we are forced to select certain elements quite a few times in a row to get the one that we need:

      return driver
          .waitForElementByXPath('//android.widget.TextView[@text="Gallery"]', 20000)
          .elementByXPath('//android.widget.TextView[@text="Gallery"]') // multiple calls here for an Android bug:
          .elementByXPath('//android.widget.TextView[@text="Gallery"]') // on Windows + Android emulator, element selection
          .elementByXPath('//android.widget.TextView[@text="Gallery"]') // is completely wonky. Unfortunately duplicating element()
          .elementByXPath('//android.widget.TextView[@text="Gallery"]') // calls is the only workaround identified thus far.
      

      Attachments

        Issue Links

          Activity

            People

              alsorokin Alexander Sorokin
              alsorokin Alexander Sorokin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: