AWS Device farm apk not uploading

0

I am unable to upload the apk on to a device on aws device farm, no error message is being displayed. I am having the same issue when running a test suite the set up passes but then tests fail, when I watched the video playback the app is not visible or installed.

Is there also somewhere I could look for errors / help / logs to guide me to locate the issue.

Edited by: QAtesterAWS on Aug 11, 2020 3:09 AM

asked 4 years ago823 views
9 Answers
0

Hello QAtesterAWS,

Uploads are done via our CreateUpload API, which returns an ARN and an upload URL for use in uploading your app. When the app is uploaded, you can view the status of the upload via the GetUpload or ListUploads APIs. If the upload failed to process, you will see the reason why in the metadata.

To view the logs for your run or job, we provide the ListArtifacts API to allow you to fetch them. If using the console, they are several download links to view the artifacts for your job when it is finished. The URL for the console webpage that has your job and links to your artifacts will resemble: https://us-west-2.console.aws.amazon.com/devicefarm/home?region=us-west-2#/projects/xxxx-xx-xxxx/runs/xxxxx-xxxxx-xx-xxx/jobs/xxxxx


References
API reference - CreateUpload: https://docs.aws.amazon.com/devicefarm/latest/APIReference/API_CreateUpload.html
CLI Reference - ListUploads: https://docs.aws.amazon.com/cli/latest/reference/devicefarm/list-uploads.html
Developer Guide - Working with Test Reports: https://docs.aws.amazon.com/devicefarm/latest/developerguide/how-to-use-reports.html#how-to-use-reports-displaying-results

AWS
answered 4 years ago
0

Hi,

I have looked through Test suite, Test spec output and Customer Artifacts but do not see any errors related to the apk.

In the logs it seems to boot up Appium just fine and attempt to runt the test but fails because app is unable to load, surely it should never get to this point if there is an issue with the app is this correct?

answered 4 years ago
0

Hello QAtesterAWS,

As long as the app installs, it will enter the test phase of the testspec file. Generally, if the app fails to launch, you can check either the Appium logs, or the ADB / iOS crash reports for errors that may have occurred on the apps launch.

AWS
answered 4 years ago
0

Hi,

I have already looked at the Appium logs and everything on there, it does not show any error or crashes. I have looked through it all numerous times and there is nothing to indicate anything is wrong.

answered 4 years ago
0

Hello,

May you provide a run URL for the run where you are experiencing this problem so that we can see if there is an issue?

AWS
answered 4 years ago
0

Hello QAtesterAWS,

From our side, your app shows that it was successfully installed on our side. The appium logs that were saved to your $DEVICEFARM_LOG_DIR show that the appium server started and was waiting for a request:

[Appium] Appium REST http interface listener started on 0.0.0.0:4723

but it does not receive a POST /wd/hub/session request to start a session after this. Can you confirm that your test application is initializing a driver to start a session at localhost with port 4723? In webdriverio, that can be done through the exports.config file. For instance:

exports.config = {
  runner: 'local',
  port: 4723,
  capabilities: [{
    platformName: 'Android',
    automationName: 'UiAutomator2',
    ...
   ]}
}
AWS
answered 4 years ago
0

Hi,

The config works locally so I'm not sure why it wouldn't work when running on device farm, the only thing I have changed in my config is i've commented out the capabilities as they are set in the yaml file.

This is my current config:

const appiumHost = '127.0.0.1';
const appiumPort = 4723;
const app = process.env.APK_PATH
const browserExtensions = require('../extensions/BrowserExtensions.js')

const waitforTimeout = 30000;
const commandTimeout = 30000;

exports.config = {
  debug: false,
  specs: ['./features/enterPointScenarios.feature',
          './features/articleScenarios.feature',
          './features/feedScenarios.feature',
          './features/onboardingScenarios.feature',
          './debugFeatures/debugScenarios.feature'],

  suites: {
    articleScenarios: [
      './features/articleScenarios.feature'
    ],
    feedScenarios: [
      './features/feedScenarios.feature'
    ],

    onboardingScenarios: [
      './features/onboardingScenarios.feature'
    ],

    debugScenarios: [
      './debugFeatures/debugScenarios.feature'
    ]
  },
  reporters: ['allure', 'spec'],
  reporterOptions: {
    allure: {
      outputDir: './allure-results/'
    }
  },

  host: appiumHost,
  port: appiumPort,

  maxInstances: 1,

  capabilities: [
    {
      /*appiumVersion: '1.17.1',
      browserName: '',
      platformName: 'Android',
      app,
      platformVersion: '9',
      deviceName: 'Pixel 2 API 28 Pie',
      automationName: 'UiAutomator2',
      waitforTimeout: waitforTimeout,
      commandTimeout: commandTimeout,
      newCommandTimeout: 30000*/
    }
  ],

  services: [
    ['appium', {
      waitStartTime: 6000,
      waitforTimeout: waitforTimeout,
      command: 'appium',
      logFileName: 'appium.log',
      args: {
        address: appiumHost,
        port: appiumPort,
        commandTimeout: commandTimeout,
        sessionOverride: true,
        debugLogSpacing: true
      }
    }]
  ],

  logLevel: 'silent',
  coloredLogs: true,
  framework: 'cucumber',
  cucumberOpts: {
    backtrace: true,
    failFast: false,
    ignoreUndefinedDefinitions: false,
    timeout: 30000,
    require: ['./stepDefinitions/CompositeSteps.js',
              './stepDefinitions/BasePageSteps.js',
              './stepDefinitions/LandingPageSteps.js', 
              './stepDefinitions/LoginPageSteps.js',
              './stepDefinitions/ArticleBrowsePageSteps.js',
              './stepDefinitions/AddListingSteps.js',
              './stepDefinitions/ArticleSteps.js',
              './stepDefinitions/MessagesPageSteps.js',
              './stepDefinitions/ProfileSteps.js',
              './stepDefinitions/FeedSteps.js',
              './stepDefinitions/MyListingsSteps.js',
              './stepDefinitions/OnboardingSteps.js',
              './stepDefinitions/MyAccountSteps.js',
              './stepDefinitions/SignUpSteps.js',
              './stepDefinitions/ProductBrowseSteps.js']

  },

  onPrepare:() => {
    console.log('<<< NATIVE APP TESTS STARTED >>>');
  },

  before: function (capabilities, specs) {
    // Add commands to WebdriverIO
    Object.keys(browserExtensions).forEach(key => {
      browser.addCommand(key, browserExtensions[key]);
    })

    //driver.removeApp('com.olioex.android.dev');
    //driver.installApp(app);
    //driver.launchApp();
  },

  afterScenario:() => {
    browser.screenshot();
    console.log('<<< SCENARIO FINISHED >>>')
  },

  afterFeature: function (uri, feature, scenarios) {
    browser.screenshot();
    console.log('<<< FEATURE FINISHED >>>')
  },

  onComplete:() => {
    console.log('<<< TESTING FINISHED >>>');
  }
};
answered 4 years ago
0

Hello QAtesterAWS,

You have logLevel set to 'silent' in your config, which is hiding some of the errors from you. Try setting this to 'debug' or 'info' to view them. One of the errors I can see is that you are missing wdio-allure-reporter from your node modules / dependencies. It is not in your bundledDependencies in your package.json, and thus might have not been bundled when you ran your npm-bundle command. Alternatively, you can also install the dependencies during the install phase in your testspec file.

AWS
answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions