CUIT:由于窗口标题更改,播放引擎无法找到控件 [英] CUIT: Playback engine failing to find control due to window title changing

查看:56
本文介绍了CUIT:由于窗口标题更改,播放引擎无法找到控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在论坛上找到适合我的情况的东西,足以为我提供解决方案,但却找不到我需要的东西。我正在测试搜索,搜索字词包含在窗口标题中("搜索结果:  XXX")。我有
尝试删除窗口标题并添加"包含"使用子字符串,但它不起作用。基本上我需要检查某些子字符串的页面源以确保阻止特定内容,因此我打开了View>来源然后
搜索。但除了最初记录的原始搜索标题窗口之外,它都失败了。如果还有其他方法我可以使用,那也会有所帮助。

I tried to find something on the forums that would apply to my situation closely enough for a solution for me, but didn't find exactly what I needed. I'm testing searches and the search term is included in the window title ("Search Result:  XXX"). I've tried removing window titles and adding a "contains" using the substring, but it's not working. Basically I need to check the page source for certain substrings to make sure specific content is blocked, so I have the test open the View > Source and then search. But it's failing on all but the originally recorded window with the original search title. If there's another method I can use, that would be helpful as well.

这是我的代码(注意我注释掉了 - 尝试了两种方法来尝试调整窗口标题问题):

Here's my code (note I commented out--tried both ways to try to tweak the window title issue):

  public void myOpenPageSourceView()

        {

            #region变量声明

            WinMenuItem uIViewMenuItem = this.UISearchResultsWindow.UIApplicationMenuBar.UIViewMenuItem;

            WinMenuItem uISourceMenuItem = this.UIItemWindow.UIContextMenu.UISourceMenuItem;

            #endregion

  public void myOpenPageSourceView()
        {
            #region Variable Declarations
            WinMenuItem uIViewMenuItem = this.UISearchResultsWindow.UIApplicationMenuBar.UIViewMenuItem;
            WinMenuItem uISourceMenuItem = this.UIItemWindow.UIContextMenu.UISourceMenuItem;
            #endregion

            uIViewMenuItem.SearchProperties.Remove(" WindowTitles");

            uIViewMenuItem.SearchProperties.Add(QUOT; WindowTitles","搜索结果:" ;, PropertyExpressionOperator.Contains);

            uIViewMenuItem.SearchProperties.Remove("WindowTitles");
            uIViewMenuItem.SearchProperties.Add("WindowTitles", "Search Results:", PropertyExpressionOperator.Contains);

       &NBSP ;    //uIViewMenuItem.WindowTitles.Remove("Search Results:foo");

            //uIViewMenuItem.WindowTitles.Contains("Search结果:");

            //uIViewMenuItem.WindowTitles.Remove("Search Results: foo");
            //uIViewMenuItem.WindowTitles.Contains("Search Results:");

            //点击"查看"菜单项

            Mouse.Click(uIViewMenuItem,new Point(18,11));

            // Click 'View' menu item
            Mouse.Click(uIViewMenuItem, new Point(18, 11));

            //点击"来源"菜单项

            Mouse.Click(uISourceMenuItem,new Point(40,9));
$
        }

            // Click 'Source' menu item
            Mouse.Click(uISourceMenuItem, new Point(40, 9));
        }

以下是控件属性:

  public class UIApplicationMenuBar:WinMenuBar

    {

       

       公共UIApplicationMenuBar(UITestControl searchLimitContainer):


                base(searchLimitContainer)

        {

            #region搜索标准

            this.SearchProperties [WinMenu.PropertyNames.Name] =" Application";&
            this.WindowTitles.Add(" Search Results:foo");

            #endregion

        }
       

        #region Properties

        public WinMenuItem UIViewMenuItem

        {

           得到
            {

                if((this.mUIViewMenuItem == null))

                {

                    this.mUIViewMenuItem = new WinMenuItem(this);

                     #region搜索标准

                    this.mUIViewMenuItem.SearchProperties [WinMenuItem.PropertyNames.Name] ="查看英寸;

                     this.mUIViewMenuItem.WindowTitles.Add([搜寻结果:FOO");

            &NBSP ;       #endregion

                }
                return this.mUIViewMenuItem;

            }
        }

 public class UIApplicationMenuBar : WinMenuBar
    {
       
        public UIApplicationMenuBar(UITestControl searchLimitContainer) :
                base(searchLimitContainer)
        {
            #region Search Criteria
            this.SearchProperties[WinMenu.PropertyNames.Name] = "Application";
            this.WindowTitles.Add("Search Results: foo");
            #endregion
        }
       
        #region Properties
        public WinMenuItem UIViewMenuItem
        {
            get
            {
                if ((this.mUIViewMenuItem == null))
                {
                    this.mUIViewMenuItem = new WinMenuItem(this);
                    #region Search Criteria
                    this.mUIViewMenuItem.SearchProperties[WinMenuItem.PropertyNames.Name] = "View";
                    this.mUIViewMenuItem.WindowTitles.Add("Search Results: foo");
                    #endregion
                }
                return this.mUIViewMenuItem;
            }
        }

我在安装了FP2的Windows 7上运行。我试着在播放时关闭SmartMatch,但这也不起作用。我是否需要创建一个新的窗口控件?

I'm running on Windows 7 with FP2 installed. I tried turning off SmartMatch on playback, but that didn't work either. Do I need to create a new window control?

推荐答案

注意:例外情况只是通常的"找不到控件"。但它显示原始录音的完整窗口标题。
Note: The exception is just the usual "failed to find control" but it displays the full window title from the original recording.


这篇关于CUIT:由于窗口标题更改,播放引擎无法找到控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆