简体   繁体   中英

How do I Store application data during a CUIT execution to use later in another test

I'm developing a Coded UI test project with Visual Studio 2012 for a WPF application. Is there a way to query and store a value from a control to use in future test in a test suite. The applications creates item ids that I want to use to display the item.

I'm answering my own question. I was over thinking the issue. I manually created a wpftext control with the appropriate search criteria and took the text value of the control. The same way the code generator defines the controls.

        private WpfText _LoadNumberText = null;
        public WpfText LoadNumberText
        {
            get
            {
                if ((this._LoadNumberText == null))
                {
                    this._LoadNumberText = new WpfText(this.UIGradeStarpoweredbyExWindow.UIItemCustom2.UIItemCustom1);
                    #region Search Criteria
                    this._LoadNumberText.SearchProperties[WpfText.PropertyNames.AutomationId] = "DocNumber";
                    this._LoadNumberText.WindowTitles.Contains("Window Title");
                    #endregion
                }
                return this._LoadNumberText;
            }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM