|
最近制作自动化脚本,发些无法定位到第三层iframe下的一个按钮
相关脚本如下:
ie.frame("mainiframe").frame("iframe_content").button(:class, "deploy-btn").click
ie.show_frames
ie.frame("mainiframe").frame("iframe_content").frame(:index,1).button(:id,"addPackageGroup").click
第二层iframe下的button执行成功后,会打开第三层框架,接着执行show_frames,依然显示只有there are 2 frames,但是用IE develpger看,有3层frame。最后一行代码也执行失败,返回错误如下
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.2/./watir.rb:2676:in `method_missing': document (WIN32OLERuntimeError)
OLE error code:80070005 in <Unknown>
拒绝访问。
HRESULT error code:0x80020009
发生意外。 from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.2/./watir.rb:2676:in `document'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.2/./watir.rb:918:in `ole_inner_elements'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.2/./watir.rb:989:in `locate_input_element'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.2/./watir.rb:3676:in `locate'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.2/./watir.rb:2366:in `assert_exists'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.2/./watir.rb:2597:in `enabled?'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.2/./watir.rb:2372:in `assert_enabled'
from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.2/./watir.rb:2542:in `click!'
但是3个iframe访问的都是同一个域名,而且我也都添加了安全信任站点了。求助!!! |
|