Forum Discussion

ussainik's avatar
ussainik
Occasional Contributor
2 years ago

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");

 

12 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

     

    "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.

  • ussainik's avatar
    ussainik
    Occasional Contributor

    Sure thanks for the clarification. I think they are being added dynamically.