不要追求绝对的公平,红尘之中没有公平而言,人活一世,难得糊涂。
it is no use doing what you like, you have got to like what you do.
针对popups类对话框的watir处理方法之四
上一篇 /
下一篇 2009-09-16 15:44:34
/ 个人分类:ruby_watir
P,G
h&_B0w6w0该列上传框的处理方式如下:
j+t!oGO ]Ng051Testing软件测试网,Y4{)o q9dR
oRmrequire 'watir'
Cz ~
RP.qo0require 'win32ole'
#vz{g4~P0require 'watir/WindowHelper'
%~%J5o(xT,R%t0# 登陆
51Testing软件测试网L:R)r?a8o"XG$ie_site ='http://members.shaw.ca/paul_rogers/watir_tests/popups1.html'
51Testing软件测试网HPx-V2B:S$f = 'E:\WorkSpace\00-Automation\03_MOA\02_Branches\JiangXi\V2.9.1\Lib\db1.vbs'
51Testing软件测试网3k%u(}"x8X3b*LA(?C6^$ie = Watir::IE.new
51Testing软件测试网)S@G|4@"g$ie.goto $ie_site
b.Vp.jdP/U0#$ie.file_fields.each {|f| puts f.to_s}
f[r/k!{0|,j0$ie.file_field(:name,"up").click_no_wait
51Testing软件测试网([fSQ:sFvsleep(5)
51Testing软件测试网lH@:Avo{autoit = WIN32OLE.new("autoitx3.control")
&J0P
X4pw^t0res = autoit.WinWait("选择文件","",1)
51Testing软件测试网'A(j{SL+on Bress =autoit.ControlFocus("选择文件","","Edit1")
51Testing软件测试网/H+JwLCresss =autoit.ControlSetText("选择文件", "","Edit1",$f)