locked
Newline characters in search property value are not respected by CodedUITest RRS feed

  • Question

  • Hi Team,

    We are using coded ui test builder to develop tests for our web application. we have some controls which differ only in the innertext  value by newline characters. But CUIT is always identifying the first control which matches the text ignoring the newline characters.

    For example:  

    Following are search properties for 2 controls which are differing in inner text. My script with action on control2 is always performing action on control1.

     public HtmlDiv Control1
            {
                get
                {
                    if ((this.mUITesttest2test3test4Pane == null))
                    {
                        this.mUITesttest2test3test4Pane = new HtmlDiv(this);
                        #region Search Criteria
                        this.mUITesttest2test3test4Pane.SearchProperties[HtmlDiv.PropertyNames.Id] = null;
                        this.mUITesttest2test3test4Pane.SearchProperties[HtmlDiv.PropertyNames.Name] = null;
                        this.mUITesttest2test3test4Pane.FilterProperties[HtmlDiv.PropertyNames.InnerText] = "test test2 \r\n\r\n\r\n test3\r\n\r\n test4";
                        this.mUITesttest2test3test4Pane.FilterProperties[HtmlDiv.PropertyNames.Title] = null;
                        this.mUITesttest2test3test4Pane.FilterProperties[HtmlDiv.PropertyNames.Class] = null;
                        this.mUITesttest2test3test4Pane.FilterProperties[HtmlDiv.PropertyNames.ControlDefinition] = null;
                        this.mUITesttest2test3test4Pane.WindowTitles.Add("C:\\Users\\smamidi\\Desktop\\test2.html");
                        #endregion
                    }
                    return this.mUITesttest2test3test4Pane;
                }
            }
            
            public HtmlDiv Control2
            {
                get
                {
                    if ((this.mUITesttest2test3test4Pane1 == null))
                    {
                        this.mUITesttest2test3test4Pane1 = new HtmlDiv(this);
                        #region Search Criteria
                        this.mUITesttest2test3test4Pane1.SearchProperties[HtmlDiv.PropertyNames.Id] = null;
                        this.mUITesttest2test3test4Pane1.SearchProperties[HtmlDiv.PropertyNames.Name] = null;
                        this.mUITesttest2test3test4Pane1.FilterProperties[HtmlDiv.PropertyNames.InnerText] = "test test2 test3\r\n\r\n test4";
                        this.mUITesttest2test3test4Pane1.FilterProperties[HtmlDiv.PropertyNames.Title] = null;
                        this.mUITesttest2test3test4Pane1.FilterProperties[HtmlDiv.PropertyNames.Class] = null;
                        this.mUITesttest2test3test4Pane1.FilterProperties[HtmlDiv.PropertyNames.ControlDefinition] = null;
                        this.mUITesttest2test3test4Pane1.WindowTitles.Add("C:\\Users\\smamidi\\Desktop\\test2.html");
                        #endregion
                    }
                    return this.mUITesttest2test3test4Pane1;
                }
            }

    Any help in resolving this issue is greatly appreciated.



    sirisha

    Friday, November 14, 2014 6:37 AM

All replies

  • Hi sirisha,

    >> But CUIT is always identifying the first control which matches the text ignoring the newline characters.

    According to your description, could you please provide me a screen shot about your UI action in web page?

    Do you mean that when you playback the control action, the coded UI test deesn’t work?

    If yes, please you provide me more detailed error log message about your issue.

    From your code, it seems that you record your Panel control on an .html page using coded UI test Builder. I tried to create an .html in web app, I found that there have no the Panel control to support on the .html page. Therefore, I try to add a webform.aspx page in web app and then add the innertext value of AssertMethod for the Panel control using coded UI. When I playback the Panel control, I found that we could identify the innertext value with newline characters.

    Since I am not the web app expert, so I could not reproduce your issue in my side. Therefore, if possible, I suggest you could provide your sample for me so that we will further help you solve this issue.

    You could upload your web application and coded UI test project to OneDrive and then copy link here.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Tina-Shi Friday, November 14, 2014 10:44 AM
    Friday, November 14, 2014 10:39 AM
  • Hi sirisha,

    I am writing to check the status of the issue on your side.

    Could you please tell us what about this problem now?

    Would you mind letting us know the latest information about this issue?

    Best Regards,



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Edited by Tina-Shi Friday, November 21, 2014 11:50 AM
    Friday, November 21, 2014 11:50 AM