簡體   English   中英

adb觸摸屏在通話中滑動失敗

[英]adb touchscreen swipe fail in a call

我正在嘗試使用觸摸和滑動來模擬使用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);

        }

    }

有任何想法嗎? 謝謝。

嘗試添加持續時間以滑動:

adb shell input touchscreen swipe <x1> <y1> <x2> <y2> [duration(ms)]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM