资源描述:
《关于使用monkey运行脚本测试》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、关于使用Monkey运行脚本测试First,runmonkeyonavirtualmachineTwowaystorunemulatorsonPC(Linux)Youcanruntheemulatorthrougheclipse,inaslightlydifferentway.The1canbedonebythecommandline:root@llin-desktop:#emulator一avdandroid2・2Entertheadbshellpattern,asfollows:Root@rus~desktop:#adbshell#Runthemonkeytooltoo
2、penthespecialport#monkey一port1080一v~v“Monkeyseed=0count=1000:IncludeCategory:android.Int・category.LAUNCHER:IncludeCategory:android.Int.category.MONKEYNote:afteryouexecutethemonkeycommand,youcanusenetstattoseeiftheportisopen,andtheredsectionbelowiswherewewanttofocus.#netstatProtoRecv-QSend-
3、qLocalAddressForeignAddressStateTCP00127.0.0.1:50370.0.0.0:*LISTENTCP000.0.0.0:55550.0.0.0:*LISTENTCP0,0127.0.0.1:10800.0.0.0:*LISTENTCP0,10.0.2.15:5555,10.0.2.2:43064ESTABLISHEDUdp0.0.0.0.0.0:554330.0.0.0:*Udp0.00.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
4、.0.0.0.0.0.0.0.0.#OpentheforwardportonthePCsideRoot@l-e~desktop:~#adbforwardTCP:1080TCP:1080Note:aftertheadbforward,youcanalsousethenetstatcommandtoseeiftheportisenabled,andthecommandisasfollows:Root@lenovo-desktop:~#Root@l-e~desktop:~#adbforwardTCP:1080TCP:1080Root@netstat-an
5、grep1080TCP0
6、,0127.0.0.1:10800.0.0.0:*LISTENRoot@lenovo-desktop:~#UsetheTelnettooltoconnecttoandroidRoot@ren~desktop:~#Telnet127.0.0.11080Trying127.0.0.1...Connectedto127.0.0.1.TheEscapecharacteris,八]'・Theabovetip,withoutanexceptionexit,indicatesthattheconnectionissuccessful,andthenyoucanusethecontents
7、ofthestepsofexample_script・txttoenterthekeyvalues.Root@ren~desktop:~#Telnet127.0.0.11080Trying127.0.0.1...Connectedto127.0.0.1.TheEscapecharacteris,J'・Keydown3OKThekeyup3OKNote:thekeydown3,keyup3,isthekeyuserinput,okisthereturnvalue,ifyouseethewordsokreturnvalues,showsthekeystoeffectiveval
8、ueofhair,otherwise,asinvalidvalues.Atthisstage,youwouldhavethoughtthat,ifmustaadidn,tenterakeyword,whataboutthemeaningofwhatelsetestautomation,itisbettertoonebyonetopress,infactisanallcommandscanbepipedtomonkey.Enterallofthecontentsofexa.mple_script・txtinaone-