0

I am new to UIAutomator for android devices. I am writing these scripts in eclipse IDE using JAVA.

I need one sample script for automating call scenario where i call from one phone and recieve the call from another phone and then i am browsing from first phone. Can we do this from one single script ?

Rishi
  • 3
  • 2

3 Answers3

1

There is also a python wrapper for uiautomator. This might help you with your task. You run the single python script to automate steps and the wrapper pushes a standard jar to each defined device (in theory).

You could take a look here: https://github.com/xiaocong/uiautomator

UPDATE:

For Linux based OS you can use:

sudo apt-get install python-pip
sudo pip install urllib3
sudo pip install uiautomator

For Windows please take a look at this question: How do I install pip on Windows?

Community
  • 1
  • 1
Gabriel Porumb
  • 1,581
  • 1
  • 10
  • 21
  • I am installing this tool. I followed below steps. Downloaded Android SDK and set the path. adb commands works correctly. Downlaoded the uiautomator from https://github.com/xiaocong/uiautomator Downloaded python 3.4 From CMD i ran command "pip install uiautomator" -> here i get failure "NameError: name 'urllib3' is not defined" Can you please help me in this. Can you please help me with some detailed steps. – Rishi Dec 09 '14 at 14:13
0

As Uiautomator scripts run from the device under test, it would not be possible to test call-receive scenario using UIautomator framework. Instead have a look at android MonkeyRunner framework. MonkeyRunner will allow you to control multiple devices from your PC.

Dnavir
  • 496
  • 3
  • 11
  • Is MonkeyRunner good for UI and functional tests also ? I heard that UIautomator is better. Please suggest as i am new to android testing which tool shall i use for Functional , UI and stability tests ? – Rishi Dec 02 '14 at 10:53
  • You can do UI and Functional tests with MonkeyRunner too but Uiautomator is better. Further, Uiautomator will not work for your call-receive scenario. You can check out the project suggested by @Gabriel Porumb. – Dnavir Dec 03 '14 at 06:45
  • I am installing this tool. I followed below steps. Downloaded Android SDK and set the path. adb commands works correctly. Downlaoded the uiautomator from github.com/xiaocong/uiautomator Downloaded python 3.4 From CMD i ran command "pip install uiautomator" -> here i get failure "NameError: name 'urllib3' is not defined" Can you please help me in this. Can you please help me with some detailed steps @Gabriel Porumb – Rishi Dec 09 '14 at 14:59
  • It is working now :-) I did "pip install urllib3" and then "pip install uiautomator" and it worked – Rishi Dec 10 '14 at 07:47
0

Its true what Rishi said and would like to add something to it. There is another open source tool called appium which can be used to handle such kind of scenarios. With UiAutomator you cannot interact with 2 devices in a single test, but you can break single test into 2 and run 1 test on one device and another on test on another devices. At the end you can parse the test result and make sure once both test passes then your whole scenario passes

Amit Kumar
  • 67
  • 3