2016-05-03 14 views
13

Sto provando a simulare una chiamata video automatica con adb utilizzando tocchi e scorrimenti. Lo scenario:touchscreen adb non riesce in una chiamata

Device1 audio chiama Dispositivo2, Dispositivo2 risponde, Dispositivo1 chiede videochiamata (bidirezionale), Dispositivo2 tenta di rispondere e non riesce. La cosa cablata è che a volte funziona, ma la maggior parte non funziona su quel punto quando il dispositivo2 tenta di rispondere via adb.

ecco il codice:

@Test(timeout = 60000000) 
    /** 
    * 
    */ 
    @TestProperties(name = "Video call/Normal video call") 
    public void VT111_0011() throws InterruptedException, IOException, AWTException { 
     initTestVariable("Normal_Video_Call_Test_VT111_0011"); 
     sleep(idleBeforeTest); 
     System.out.println("Starting normal video test"); 
     Android.adbCommand(secondDevice.getDevice1(), "adb -s " + secondDevice.getDeviceID() + " shell input touchscreen swipe 355 858 590 858"); 

     for(int i=0; i<Iteration; i++) { 
      moveMouse(); 
      Jsystem.broadCastMessage("\nIteration " + i, globalVar.nameForLogFile); 
      cleanLogs(); 
      firstDevice.call(secondDevice); 
      Thread.sleep(2000); 
      if(secondDevice.isRinging()) 
       secondDevice.answerCall(1000); 
      else{ 
       ringingFail(); 
      } 

      // Start video by gui 
      Android.adbCommand(firstDevice.getDevice1(),"adb -s " + firstDevice.getDeviceID() + " shell input tap 650 380"); 
      Android.adbCommand(firstDevice.getDevice1(),"adb -s " + firstDevice.getDeviceID() + " shell input tap 420 470"); 
      Thread.sleep(1000); 
      Android.adbCommand(firstDevice.getDevice1(),"adb -s " + firstDevice.getDeviceID() + " shell input tap 197 780"); // 197 920 Video bidirectional 
      Thread.sleep(5500); 
      // Device2 answers video 
      Android.adbCommand(firstDevice.getDevice1(),"adb -s " + firstDevice.getDeviceID() + " shell input tap 355 858"); // 197 920 Video bidirectional 
      Android.adbCommand(secondDevice.getDevice1(), "adb -s " + secondDevice.getDeviceID() + " shell input touchscreen swipe 355 858 590 858"); 
      Thread.sleep(200); 
      Android.adbCommand(firstDevice.getDevice1(),"adb -s " + firstDevice.getDeviceID() + " shell input tap 60 372"); 
      Android.adbCommand(secondDevice.getDevice1(),"adb -s " + secondDevice.getDeviceID() + " shell input tap 60 372"); 


     /* Thread.sleep(5000); 
      if((!firstDevice.isInCall()) || (!secondDevice.isInCall())){ 
       inCallFail(); 
       continue; 
      } */ 
      int failsCounter = 0; 
      VerifyVideo verifyVideo = new VerifyVideo(); 
      for(int j = 8; j<10; j++){ 
       if(verifyVideo.verrfiyVideo(firstDevice, secondDevice) == false) 
        failsCounter++; 
      } 
      if(failsCounter>2) { 
       Jsystem.broadCastMessage("****** TEST FAILED, VIDEO DOSENT WORK GOOD ENOUGH ****** " , globalVar.nameForLogFile); 
       System.out.println("Number of fails: " + failsCounter); 
       comparePhototsFail(); 
      } 

      firstDevice.endCall(); 
      secondDevice.endCall(); 
      sleep(TimeBetweenIteration); 

     } 

    } 

Tutte le idee? Grazie.

+0

Cosa intendi con "cerca di rispondere e fallisce"? Cosa vedi sul dispositivo stesso? Se provi a rispondere manualmente a una videochiamata, hai SEMPRE successo? – TDG

+0

Quando eseguo questo codice, secoundDevice prova a rispondere c'è un massaggio popup "purtroppo il telefono si è fermato" e non c'è video ... Quando faccio lo stesso scenario manualmente funziona sempre. –

risposta

0
secondDevice tries to answer there is a popup message "unfortunately phone has stopped 

Questo è un problema con il dispositivo/app e non con lo script. Prova a prendere i registri e postare qui.

Per questo script, è necessario innanzitutto ottenere la risoluzione del dispositivo e verificare che non si stia sfiorando dall'altezza o dalla larghezza della risoluzione.

shell input touchscreen swipe 355 858 590 858 

Inoltre, andare in Opzioni sviluppatore e attivare 'Mostra tocca' e 'Show Pointer Località' così che si può 'vedere' dove esattamente ha fatto il tocco/colpo accadere.

+0

Informazioni sulla posizione e la risoluzione L'ho già fatto, Riguardo ai registri che ho cercato, lo caricherò ora –

Problemi correlati