|
测试的是window上的程序,不是web,想调用vbs脚本中的返回值arrxput和arryput,但是在调用vbs脚本中的selectprovince()出现General run error,求大神帮忙。。Vbs脚本通过resource调用的,求大神帮帮忙
action代码入下:
Dim arrx,arry
Dim i '循环次数
Set shell=CreateObject("Wscript.Shell")
Shell.Run"F:\【pc】\Tcar2\pc\client_tcar_pc.exe"
Window("CJTNavi_2").VirtualButton("button_zhan").Click
Window("CJTNavi_2").VirtualButton("button_menu").Click
Window("CJTNavi_2").VirtualButton("button_mainsearch").Click
Window("CJTNavi_2").VirtualButton("button_province").Click
selectprovince()
Window("CJTNavi_2").VirtualButton("button_d").Click
Window("CJTNavi_2").VirtualButton("button_a").Click
Window("CJTNavi_2").VirtualButton("button_da").Click
Window("CJTNavi_2").VirtualButton("button_search2").Click
Window("CJTNavi_2").VirtualButton("button_position").Click
Vbs脚本
Function SelectProvince(arrxput,arryput)
Dim arrx,arry
Dim mycolumeX,mycolumeY
Dim toNum,fromNum
toNum=4
fromNum=0
arrx=Array("p_X1","p_X2","p_X3","p_X4","Next_X")
arry=Array("p_Y1","p_Y2","p_Y3","p_Y4","Next_Y")
Randomize
mycolumeX=Int((toNum-fromNum+1)*Rnd+fromNum)
arrxput=arrx(mycolumeX)
Randomize
mycolumeY=Int((toNum-fromNum+1)*Rnd+fromNum)
arryput =arry(mycolumeY)
End Function |
|