1

我的问题是:

device.drag((200,350),(200,150))
MonkeyRunner.sleep(6)
vc.dump()

我的测试停止工作。有谁知道我可以使用一个命令来代替 vc.dump() 吗?之后我需要一个命令device.drag((200,350),(200,150))才能让我的测试继续工作。

4

1 回答 1

0

在 4.2 模拟器 ( API 17 )上的 Launcher 上使用culebra生成脚本,并在最后添加脚本按预期工作。drag

#! /usr/local/bin/shebang monkeyrunner -plugin $AVC_HOME/bin/androidviewclient-$AVC_VERSION.jar @!
# -*- coding: utf-8 -*-
'''
Copyright (C) 2013  Diego Torres Milano
Created on 2013-05-13 by Culebra v0.9.8

                      __    __    __    __
                     /  \  /  \  /  \  /  \ 
____________________/  __\/  __\/  __\/  __\_____________________________
___________________/  /__/  /__/  /__/  /________________________________
                   | / \   / \   / \   / \   \___
                   |/   \_/   \_/   \_/   \    o \ 
                                           \_____/--<
@author: Diego Torres Milano
@author: Jennifer E. Swofford (ascii art snake)
'''


import re
import sys
import os


from com.dtmilano.android.viewclient import ViewClient

from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice

device, serialno = ViewClient.connectToDeviceOrExit()
vc = ViewClient(device, serialno, autodump=False)
vc.dump(window='-1')

print "### before drag ###"
vc.traverse(transform=ViewClient.TRAVERSE_CIT)
device.drag((450,200),(50,200))
MonkeyRunner.sleep(6)

print "### after drag ###"
vc.dump()
vc.traverse(transform=ViewClient.TRAVERSE_CIT)
于 2013-05-13T21:54:32.480 回答