The playback could not find the control with the given search properites with the Tab Button

Locked The playback could not find the control with the given search properites with the Tab Button

  • Tuesday, April 24, 2012 8:29 PM
     
     

    Hi there,

    I created a test (a WPF Window) in which i have to use "TAB" key to move to the next window.  But, in the playback i keep getting the exception" The playback failed to find the control wiht the given search properties"

    Thanks

All Replies

  • Wednesday, April 25, 2012 4:07 AM
     
     

    Hi developer.vsdotnet,

    Can you please put your code here that is causing the exception?

    -Tejas.

  • Wednesday, April 25, 2012 5:07 AM
     
     
    I don't see any statement related to pressing 'TAB' key in above code. Can you please highlight the statement that is throwing the exception?
    • Edited by TejasJ Wednesday, April 25, 2012 5:08 AM
    •  
  • Wednesday, April 25, 2012 9:32 AM
     
     

    If you record your tab control action the code will look like this in the recorded method in designer.cs file

    // Type '{Tab}' in 'id' text box

    Keyboard.SendKeys(uIIDEdit, this.RecordedMethod2Params.UIIDEditSendKeys, ModifierKeys.None);check this type and re record and do it,hope it will clear you problem

  • Wednesday, April 25, 2012 10:04 AM
     
      Has Code

    Or go with a top level control:

    Keyboard.SendKeys(UIMap.MyWindow, this.RecordedMethod2Params.UIIDEditSendKeys, ModifierKeys.None);

    or just without the control:

    Keyboard.SendKeys(this.RecordedMethod2Params.UIIDEditSendKeys, ModifierKeys.None);

    -Tejas.

  • Thursday, April 26, 2012 8:14 AM
    Moderator
     
     

    Hi developer.vsdotnet,

    Seems like the uIREADButton could not be found during playback, you could use test builder to find out which property exposed by this control and add it into this control's search properties group.


    Tony Xiao [MSFT]
    MSDN Community Support | Feedback to us


  • Friday, April 27, 2012 3:17 PM
     
     

    @ Tony Xiao.

    Thanks for your assistance. How do I go to control's search properties group.   I am pretty new to this testing. 

    Thanks!

  • Monday, April 30, 2012 2:48 AM
    Moderator
     
      Has Code

    Hi developer.vsdotnet,

    There are two ways could achieve this:

    1. Double-click UIMap.uitest file in your solution explorer then it will be opened by UIMap editor if you have installed Feature pack 2, please see the following figure about this:

    2. Locate the definition of the control which you want to modify in UIMap.designizer.cs then try to add or change specific search property in Search Criteria of that control.


    	    [GeneratedCode("Coded UITest Builder", "10.0.40219.1")]
    	    public class UIDesktopList : WinList
    	    {
    	        
    	        public UIDesktopList(UITestControl searchLimitContainer) : 
    	                base(searchLimitContainer)
    	        {
    	            #region Search Criteria
    	            this.SearchProperties[WinList.PropertyNames.Name] = "Desktop";
    	            this.WindowTitles.Add("Program Manager");
    	            #endregion
    	        }
    	        
    	        #region Properties
    	        public WinListItem UIItem7zipListItem
    	        {
    	            get
    	            {
    	                if ((this.mUIItem7zipListItem == null))
    	                {
    	                    this.mUIItem7zipListItem = new WinListItem(this);
    	                    #region Search Criteria
    	                    this.mUIItem7zipListItem.SearchProperties[WinListItem.PropertyNames.Name] = "7-zip";
    	                    this.mUIItem7zipListItem.WindowTitles.Add("Program Manager");
    	                    #endregion
    	                }
    	                return this.mUIItem7zipListItem;
    	            }
    	        }
    	        #endregion
    	        
    	        #region Fields
    	        private WinListItem mUIItem7zipListItem;
    	        #endregion
    	    }
    	

    Hope this could help you.


    Tony Xiao [MSFT]
    MSDN Community Support | Feedback to us



  • Monday, April 30, 2012 7:35 PM
     
     Answered Has Code
                    

    //Adding these lines in test method solved my problem

         


    Step 1. //Define the variable

    Dim uITxtTimeBuildEdit As WinEdit = Me.UIAUTFORMSWindow.UITxtTimeBuildWindow.UITxtTimeBuildEdit

    //Step 2

    uITxtTimeBuildEdit.Text = Me.Time2Params.UITxtTimeBuildTEditText 'Type '{Tab}' in 'txtTimeBuild' text box Keyboard.SendKeys(uITxtTimeBuildEdit, Me.EmpTime2Params.UITxtTimeBuildEditSendKeys, ModifierKeys.None) 'Type '{Tab}' in 'READ' button Keyboard.SendKeys(uIREADButton, Me.EmpTime2Params.UIREADButtonSendKeys, ModifierKeys.None) Step 3.// Passing these in method params Public UITxtTimeBuildEditSendKeys As String = "{Tab}" '''<summary> '''Type '{Tab}' in 'READ' button '''</summary> Public UIREADButtonSendKeys As String = "{Tab}"





  • Monday, April 30, 2012 7:36 PM
     
     

    @ Tony Xiao.

    Thanks for your post.  It was of great help. Thanks.

  • Tuesday, May 01, 2012 1:54 AM
    Moderator
     
     

    Hi developer.vsdotnet,

    It's glad to see this issue has been resolved and thanks for sharing your solution here.

    Have a nice day!


    Tony Xiao [MSFT]
    MSDN Community Support | Feedback to us