据我所知,UFT 's web support can' t处理此类案件 . 这可能是UFT基于图像的自动化(aka Insight)可以使用的情况 .
如果UFT无法将它们识别为本机 WinButton ,则可以使用Insight识别所需的按钮 .
0
我不得不应用自己的解决方法来管理从此设置中保存文件 . 这是我使用的代码:
If Browser("AFBHome").WinObject("Notification").Exist(6) Then
LOG_Write "Notification received - click Save dropdown to get file."
Browser("AFBHome").WinObject("Notification").WinButton("SaveDropdown").Click micNoCoordinate,micNoCoordinate,micRightBtn
Browser("AFBHome").WinObject("Notification").WinButton("SaveDropdown").Click
Wait 0,500 ' Allow the dropdown to render
Browser("AFBHome").WinObject("Notification").WinButton("SaveDropdown").Type "a"
Dialog("Save As").Activate
Wait 0,500
LOG_Write "Getting file from AFB: " & Dialog("Save As").WinEdit("FileName").GetROProperty("text")
Dialog("Save As").WinEdit("FileName").SetSelection 0,Len(Dialog("Save As").WinEdit("FileName").GetROProperty("text"))
Dialog("Save As").WinEdit("FileName").Type sSaveLocation & sFilename
LOG_Write "Attempting to save export file as " & sSaveLocation & sFilename
Dialog("Save As").WinButton("Save").Click
End If
2 回答
据我所知,UFT 's web support can' t处理此类案件 . 这可能是UFT基于图像的自动化(aka Insight)可以使用的情况 .
如果UFT无法将它们识别为本机
WinButton
,则可以使用Insight识别所需的按钮 .我不得不应用自己的解决方法来管理从此设置中保存文件 . 这是我使用的代码:
我必须将通知栏作为WinObject学习到OR,并且SaveDropdown对象附加到末尾的向下箭头 . 我还必须使用
.SetSelection
和.Type
方法而不是普通的.Set
,因为SaveAs
对话框最终会将文件保存到最初指定的内容而不是所需的路径和文件名 .您可以忽略
LOG_Write
语句,因为它们是我用来跟踪脚本进度的自定义函数 .