0

image shows the login and logout so i want to test this app for 1000 times using shell script. here is my flow below is code

`Analytics_test(){
#to launch the app use below command 
adb shell am start -n  pacagename/activaity
sleep 1
#to clcik on Anlyatics Test 
adb shell input tap 146 193
sleep 1
# to click on login 
adb shell input tap 386 136
sleep 1
#to logout 
adb shell input tap 386 136
sleep 1
adb shell input tap 399 300
sleep 1
# to click on back 
adb shell input tap 474 1401 }

#iteration for 20 times for (( i=0; i<=20; i++ )) do Analytics_test done`

so my question is for one mobile device say one plus 8 pro i can find out x and y value for tap touch but when i run same script for other device like Samsung s20 or all other Android device the script doesnot not work due to wrong x and y value for touch login and logout

so is there any method in Android so we can get the x and y value for tap touch position will get auto updated if we change the device

mad_501
  • 1
  • 3
  • In order to improve the chances of getting an answer, you should provide a sample of the code you are running and the detailed steps that you have executed which work differently on the different devices. Right now, the format of your question is hard to read and without the code sample, it is difficult to understand what you are trying to do. – Jason K. Mar 09 '21 at 01:39
  • @JasonK.added code for so problem is if i change the device tap value of x and y for login and logout changes and script will not work for other device , so is there any method so we can write script to tap which will work on all type of device . Thank you in advance – mad_501 Mar 10 '21 at 19:47
  • You are not going to have it that easy. The problem is that the layout will change per device resulting in the need to set coordinates per device type. For each of the devices you need, you will have to manually select the coordinates, save them in a file for example and use the right file per device that you are testing. – Jason K. Mar 10 '21 at 19:54
  • https://stackoverflow.com/q/26586685/1778421 – Alex P. Mar 11 '21 at 15:45

0 Answers0