Arokh
Arokh

Reputation: 71

Appium/TestNG script on AWS device farm - could not find element

I am setting up my Appium/TestNG script in java on AWS Device Farm, using the tutorial: http://docs.aws.amazon.com/devicefarm/latest/developerguide/test-types-android-appium-java-testng.html After I compile and upload the 'zip-with-dependencies.zip' to AWS Device Farm and run the tests on a device, I get an error, that the first clickable element in the script could not be found. So the Setup and Teardown suite are passing in the run, but the actual test fails every time: Failure Description on AWS Device Farm

My question is am I missing something from the configuration or is the script in need of any extra desired capabilities in order to actually execute the test on AWS Device Farm?

Upvotes: 2

Views: 995

Answers (3)

Appu Mistri
Appu Mistri

Reputation: 843

Answering this for people who are still facing this issue.

You have to set up the automationName desired capability to the automation mechanism that you are using to automate the tests.

For me setting it up to uiautomator2 works.

capabilities.setCapability("automationName", "uiautomator2");

Upvotes: 1

Arokh
Arokh

Reputation: 71

I changed the version of the tested app with another one, seems like the previous one, where the element could not be found was popping out an android system message, which could not be clicked with the provided code, hence the searched element could not be found. Another thing that device farm is not so good at - providing real time observations on the running tests, which could save a lot of time in this situations.

Upvotes: 1

Hongda Zhao
Hongda Zhao

Reputation: 101

Two suggestions: 1. Set element waiting time to be less than 60 seconds, because default Appium session will timeout after that. 2. Create a screenshot for the failure, check whether the element was loaded correctly.

Hope this would help:)

Thanks, Hongda

Upvotes: 0

Related Questions