【问题标题】:Robotframework-WhiteLibrary : Windows app automation : Click button keyword is leading to failureRobotframework-WhiteLibrary:Windows 应用自动化:单击按钮关键字导致失败
【发布时间】:2019-02-27 19:57:55
【问题描述】:

我们正在尝试使用 Robotframework-Whitelibrary 自动化只能通过 Citrix Receiver 访问的 Windows 应用程序。我能够成功启动 Citrix Receiver。但是附加窗口,之后的单击按钮不起作用。 “找不到标题为“Citrix Receiver”的窗口是显示的错误。没有“附加窗口”命令,我将无法访问应用程序内的任何元素。我不确定我在这里做错了什么。测试& 故障信息如下。

*** Test Cases ***
Test1

     Launch Application    ${Test Application} 
     Sleep            3sec
     Attach Window    Citrix Receiver
     WhiteLibrary.Click Button    text:Open

|失败 | AutomationException:找不到标题为 Citrix 的窗口 接收器在进程 17020,在等待 30 秒后 TestStack.White.Factory.ChildWindowFactory.WaitTillFound(Func`1 find, 字符串消息)在 TestStack.White.Factory.WindowFactory.CreateWindow(字符串标题, Process进程,InitializeOption选项,WindowSession windowSession) 在 TestStack.White.Application.GetWindow(字符串标题, InitializeOption 选项)

【问题讨论】:

    标签: windows automation robotframework


    【解决方案1】:

    解决方案:

    我必须执行以下操作,启动并附加应用程序,然后附加窗口。 之后,我能够在应用程序中找到该元素。

         Launch Application    ${Test Application} 
         Attach Application By Id    ${pid}
         Attach Window    window_title=Citrix Receiver
    

    【讨论】:

      【解决方案2】:

      你可以使用

      @{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
      

      【讨论】:

        猜你喜欢
        • 2019-08-23
        • 2015-02-23
        • 1970-01-01
        • 2023-02-13
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多