0

I am using Amazon Device farm -Appium Java TestNG for testing of my android application. I am new to ADF. I am uploading my app and dependency zip, after completing the test, I am getting attached Unique failure error:

Image

I have tried two type of code to identify elements :

  1. Using Index of elements
  2. Resource id and Content description of elements

Following is my code:

driver.findElement(By.xpath("//android.widget.EditText[contains(@resource-id,'username')]")).sendKeys("testuser11@mailinator.com");
driver.findElement(By.xpath("//android.widget.EditText[contains(@resource-id,'password')]")).sendKeys("Commonapp1!");

driver.findElement(By.xpath("//android.widget.Button[contains(@content-desc,'Log In')]")).click();;

Have I missed something?

Appu Mistri
  • 768
  • 8
  • 26

1 Answers1

0

I work for the AWS Device Farm team.

The best ways to debug this would be:

1. Video:: If you look at the video of the test run you will be able to figure out if the element was actually visible while the test was expecting it.

2. Page source dump: You could dump the UI tree (page source) in your test to figure out which elements are been shown at the time you are looking for them

3. Don't mix different types of waits:: Another case where we see elements not been found on the screen is when the test code mixed implicit, explicit wait times. This can cause the time one assumes the appium driver waited to be different than what it actually was.

Hope that helps you proceed. If not, you can share the run URL and I can look in the runs.

NikofTime
  • 729
  • 3
  • 4
  • I have seen the videos, for some devices a korian keyboard is displayed and for some Software update modals populate so my test gets failed. Run URL is "https://us-west-2.console.aws.amazon.com/devicefarm/home?region=us-west-2#/projects/4158fcc6-c06e-4c60-ae05-551ff6e7c9e4/runs" Project name is "Car Pool1". – user2881287 Sep 22 '16 at 01:58
  • Can you past the run URL which includes the run id also ? So you would have to go to a run and then copy the run url. This will include the run id too. More helpful would be go the device which shows you the keyboard and then share the url. This way we can zero down on the device faster. – NikofTime Oct 03 '16 at 16:52