SelectTabItem hangs with ShowDialog #549
Unanswered
gabello306
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an application that opens a form to select a DataGrid which works well. When this is complete it then opens the main form which has Tabs along the top of the form with the data already in the first tab. I then select all the tabs on the main form and confirm that there are two tabs. I then select the second tab and this brings up another window but this is where the SelectTabItem seems to hang up. It doesn't move on so I can select the window and get the new grid to select items from. Below is the code I am using.
``
Window tableSelectionWindow = app.GetMainWindow(automation);
var datagrid = tableSelectionWindow.FindFirstDescendant(cf => cf.ByAutomationId("TableDataGrid")).AsDataGridView();
var tableSelection = datagrid.Rows[1].Cells[0];
tableSelection.Click();
var okBtn = tableSelectionWindow.FindFirstDescendant(cf => cf.ByAutomationId("OkButton")).AsButton();
okBtn.Click();
Window databaseWindow = app.GetMainWindow(new UIA3Automation());
var tabControl = databaseWindow.FindFirstDescendant(cf => cf.ByClassName("TabControl")).AsTab();
Assert.AreEqual(tabControl.TabItems.Length, 2); //See if we opened the Database
tabControl.SelectTabItem(1);
``
I also would like to know how to get the new popup window to select the data from. I would suspect it is a ModalWindow but I am not sure since the SelectTabItem hangs before I can get the new data.
Beta Was this translation helpful? Give feedback.
All reactions