public void InteractiveWithDisplayFormAndWpfWindow() { // 1) Create and display form and WPF window VisualStudio.InteractiveWindow.SubmitText(@"Form form = new Form(); form.Text = ""win form text""; form.Show(); Window wind = new Window(); wind.Title = ""wpf window text""; wind.Show();"); var form = AutomationElementHelper.FindAutomationElementAsync("win form text").Result; var wpf = AutomationElementHelper.FindAutomationElementAsync("wpf window text").Result; // 3) Add UI elements to windows and verify VisualStudio.InteractiveWindow.SubmitText(@"// add a label to the form Label l = new Label(); l.Text = ""forms label text""; form.Controls.Add(l); // set simple text as the body of the wpf window Wpf.TextBlock t = new Wpf.TextBlock(); t.Text = ""wpf body text""; wind.Content = t;"); var formLabel = form.FindDescendantByPath("text"); Assert.Equal("forms label text", formLabel.CurrentName); var wpfContent = wpf.FindDescendantByPath("text"); Assert.Equal("wpf body text", wpfContent.CurrentName); // 4) Close windows VisualStudio.InteractiveWindow.SubmitText(@"form.Close(); wind.Close();"); }