我正在尝试使用 Rautomation 自动化 IE11 通知栏(下载文件时)。使用 MSUIA 适配器,我能够捕捉到保存按钮。但我想使用另存为来提供文件位置和名称。但我不能那样做。
当使用 UIspy 看到时,我看到有一个名为“保存”的拆分按钮。此拆分按钮有另一个名为“”的子拆分按钮(基本上是向下箭头)-我无法访问此控件。
iemainwindow_local = RAutomation::Window.new(:class=>"IEFrame" , :adapter => :ms_uia )
ienotificationbar_frame = iemainwindow_local.child(:class=>"Frame Notification Bar")
ienotificationbar = ienotificationbar_frame.child(:class=>"DirectUIHWND")
if ienotificationbar.exists?
ienotificationbar.activate
sleep 1
mycontrol = ienotificationbar.control(:value =>"Save")
mycontrol2= mycontrol.control(:children_only => true)
mycontrol2.exist?
mycontrol.click
end
在这一行出现错误 mycontrol2= mycontrol.control(:children_only => true)
undefined method `control' for #<RAutomation::Adapter::MsUia::Control:0x4108e60>
知道如何克服这个障碍吗?
我知道应该有一个与 splitButton 关联的菜单和菜单项,当我单击保存之外的向下箭头时,在 UISpy 我看到菜单/菜单项直接在桌面窗口下创建(尽管 processID 相同) - 如何抓住菜单项另存为?