Appium Android Testing Using UIAutomator Image Upload Feature

Sagar Tripathi
3 min readOct 10, 2019

--

Hi Folks,

Last Week I am facing some Issue during Appium Testing Using UIAutomator .

I need to Automate payment page but After try to take screenshot during testing it show me error .

Error During UIAutomator

I check this Error and find that payment gateway not show me the elements to fetch the data.But any how i need to get that page element to validate the text which are passing to that so i do some R&D so after wasting my whole 1 day finally got solutions.

So I feel that many of you feeling same issue to get the element. So because of that I am writing the whole solution of that problem.

So the Solution start for the UIAutomator Screen

Above is the Image of the screen which i need to automate but this is third party application so i am getting error .

So Step to Automate Screen Using Manual Screenshot

Steps

  1. Open UIAutomator
  2. Open you Emulator from any tools eg:-genymotion or Android Studio

Now open page which you need to automate

Click on the file Icon and new pop-up open for upload screenshot and file xml.

Now you need to take screenshot for that page which you need to upload.

After take screenshot check your screenshot location or if you want to change you screenshot file location just go to setting and change file location.

Now you need xml file also for that Application location .

Open you command prompt (window+R) and open cmd and enter below command.Run below Command in cmd.

adb shell uiautomator dump && adb pull /sdcard/window_dump.xml && start window_dump.xml

It will open your xml file in browser .

Just copy the given path and go to UIAUTOMATOR and now upload you screenshot and xml file path in the given pop-up.

After click Ok Button you can see your automation screen and element which you need to fetch the data.

This is my experiences so i am sharing my Real Life problems with you guys because many time minor issue waste lots of time.

So Enjoy and Happy coding. :)

--

--