Click on the selected item of a tabstrip control in WinForms.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Click on the selected item of a tabstrip control in WinForms.
I am trying to automate a winforms application and when I use the object spy, it says its a tab strip control name is tabstrip1. How do I click/select the different tabs based on the name?
I try something like this but it doesn't work
//Aliases.EchoClientUtility.EchoClientApplicationForm.splitContainerMain.SplitterPanel.splitContainerUpper.SplitterPanel2.tabControl.tabStrip1.Click(178, 14); I don't want 178,14, I want to click based on the name.
//Aliases.EchoClientUtility.EchoClientApplicationForm.splitContainerMain.SplitterPanel.splitContainerUpper.SplitterPanel2.tabControl.WinFormsObject("tabControlPanelSurvey")
Aliases.EchoClientUtility.EchoClientApplicationForm.splitContainerMain.SplitterPanel.splitContainerUpper.SplitterPanel2.tabControl.tabStrip1.Click("tabControlPanelSurvey");
- Labels:
-
Desktop Testing
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For the first question, for some reason the tab is not highlighted but the whole container below the tab control highlighted.
For the second, If I am on an other tab other than Survey, it complains "Unable to find object tabControl("tabControlPanelSurvey")."
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"tabControl" is not a specific tab, but can be considered as a container for tabs.
I think your other tabs are dynamically created when clicked on. Hence, TC won't be able to recognise the tab names. Ask your developers if they can some how make the tabs static.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sure thanks for the clarification. I think they are being added dynamically.

- « Previous
-
- 1
- 2
- Next »
- « Previous
-
- 1
- 2
- Next »