2016-05-03 10 views
13

タッチとスワイプを使用してadbで自動ビデオ通話をシミュレートしようとしています。 シナリオ:adbタッチスクリーンスワイプがコールに失敗する

Device1オーディオコールDevice2、Device2が応答すると、Device1はビデオコールを要求し(双方向)、Device2は応答を試み、失敗します。 有線のものは動作することがありますが、デバイス2がadbのスワイプで応答しようとすると、その点でほとんどが失敗します。

@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); 

     } 

    } 

任意のアイデア:ここ

は、コードのですか?おかげさまで

+0

「答えようと失敗する」とはどういう意味ですか?デバイス自体には何が表示されますか?手動でビデオ通話に応答しようとすると、いつも成功していますか? – TDG

+0

このコードを実行すると、secoundDeviceはポップアップ・マッサージが「不幸にも電話が停止しました」と答えて、ビデオは表示されません。同じシナリオを手動で実行すると、毎回動作します。 –

答えて

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

これは、デバイス/アプリでは問題でスクリプトではありません。ログを取ってここに投稿してみてください。

このスクリプトでは、最初にデバイスの解像度を取得し、解像度の高さまたは幅の外側にスワイプしていないことを確認する必要があります。

shell input touchscreen swipe 355 858 590 858 

また、開発者向けのオプションに移動し、正確にタッチ/スワイプが起こった場所を「見る」ことができるように「ショーが触れる」と「ショーポインタの場所」を可能にします。

+0

場所と解像度について私がすでにやったことは、ログについて私は検索した、今すぐアップロードする –

関連する問題