You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
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