Robotframework白库:Windows应用程序自动化:单击按钮关键字导致失败
我们正在尝试使用Robotframework Whitelibrary自动化一个只能通过Citrix Receiver访问的windows应用程序。我成功地启动了Citrix接收器。但附加窗口后,点击按钮即不起作用。“找不到标题为“Citrix Receiver”的窗口是显示的错误。如果没有“Attach window”命令,我将无法访问应用程序中的任何元素。我不确定我在这里做错了什么。下面是测试和失败信息Robotframework白库:Windows应用程序自动化:单击按钮关键字导致失败,windows,automation,robotframework,Windows,Automation,Robotframework,我们正在尝试使用Robotframework Whitelibrary自动化一个只能通过Citrix Receiver访问的windows应用程序。我成功地启动了Citrix接收器。但附加窗口后,点击按钮即不起作用。“找不到标题为“Citrix Receiver”的窗口是显示的错误。如果没有“Attach window”命令,我将无法访问应用程序中的任何元素。我不确定我在这里做错了什么。下面是测试和失败信息 *** Test Cases *** Test1 Launch Applic
*** Test Cases ***
Test1
Launch Application ${Test Application}
Sleep 3sec
Attach Window Citrix Receiver
WhiteLibrary.Click Button text:Open
|失败|自动异常:找不到标题为Citrix的窗口
接收器在过程17020中,在等待30秒后
TestStack.White.Factory.ChildWindowFactory.WaitTillFound(Func`1查找,
字符串消息)在
TestStack.White.Factory.WindowFactory.CreateWindow(字符串标题,
进程、初始化选项、WindowsSession(Windows Session)
在TestStack.White.Application.GetWindow(字符串标题,
初始化选项)
解决方案:
我必须执行以下操作,启动并附加应用程序,然后附加窗口。
之后,我能够在应用程序中找到元素
Launch Application ${Test Application}
Attach Application By Id ${pid}
Attach Window window_title=Citrix Receiver
你可以用
@{windows}= Get Application Windows Locator
${wind_length}= Get Length ${windows}
log to console ${wind_length}
#above code to see how many windows are the in the application
#you can use index to switch window
Attach Window ${windows}[0]
#will attach the window in '0'th index