Is there a way to automate C1 WinForm controls via teststack.white?

Posted by: Jeff.Huckins on 18 March 2019, 5:34 am EST

    • Post Options:
    • Link

    Posted 18 March 2019, 5:34 am EST

    We’re using teststack.white for our UI automation testing, so have a need to automate the various C1 Studio controls in our application.

    Can this be done?

    Thanks in advance!

    Jeff

  • Posted 18 March 2019, 11:41 pm EST

    Hello Jeff,

    I am discussing your requirement with the developers [ID: 371612] and would get back to you as soon as I have some confirmation.

    Thanks,

    Ruchir

  • Posted 21 March 2019, 2:00 am EST

    Hi Jeff,

    C1 WinForms Studio controls partially support Automation.

    Some controls fully support Automation, some not.

    You can checkout by yourself with a tool like inspect.exehttps://docs.microsoft.com/en-us/windows/desktop/WinAuto/inspect-objects or http://www.codeplex.com/UIAutomationVerify

    Or give us a list of controls you’re interested in and we’ll check if they support automation for you.

    Thanks,

    • Alexey
  • Posted 4 September 2019, 7:02 am EST

    Alexey,

    Thank you for your response. We need to automate C1FlexGrid.

    I’ve tried using TestStack.White Table, but it doesn’t work. It finds the rows, but indicates zero cells for the rows when there are 4.

    This is really important for us, as we use Component One FlexGrid a lot throughout our application.

    Thanks,

    Jeff

  • Posted 4 September 2019, 4:15 pm EST

    Hello Jeff,

    I am getting back to the developer with this information and will come back to you once I have some information.

    Regards,

    Ruchir

  • Posted 5 September 2019, 4:11 am EST

    Thank you, Ruchir!

  • Posted 5 September 2019, 7:47 am EST

    Some additional info:

    • I’ve used Accessibility Insights tool to verify that the control is accessible, including rows and columns
    • I’ve been using TestStack.White.UIItems.TableItems.Table class, which doesn’t seem to provide row/column access to set the text in a cell.

    Is there a different automation class that I should be using?

  • Posted 5 September 2019, 4:58 pm EST

    Hello Jeff,

    As I understand, TestStack.White works on top of UIAutomation framework of .Net. If you intend to have third party controls in your application, you should verify whether these controls are supported by UIA. You can use UIAutomationVerify http://www.codeplex.com/UIAutomationVerify to check this.

    When any control is supported, the tool would show you the inner details of the control in a tree form.

    To see whether ComponentOne control(s) supports Automation, you may use a tool inspect.exe: https://docs.microsoft.com/en-us/windows/win32/winauto/inspect-objects

    Again, I’m discussing with the developer about C1FlexGrid’s support for Automation.

    Thanks.

    Ruchir

  • Posted 6 September 2019, 3:05 am EST

    Yes, Ruchir. FYI, inspect-objects is a “legacy” tool, the site suggests using Accessibility Insights and provides a link to get to it.

    And, as I said, the Accessibility Insights tool gets access to the C1FlexGrid object in our app and claims it is accessed as a FlexGrid, however, I can’t find a FlexGrid class in UI Automation, so I can’t figure out what class to use and/or how to code it to set values in row/column cells.

  • Posted 9 September 2019, 12:52 am EST

    Hi Jeff,

    Like mentioned by Alexey, ComponentOne controls partially support Automation. To confirm how much C1FlexGrid supports UIAutomation, developers are investigating over it. Once they have some conclusion, I’ll update you about the same.

    ~Ruchir

  • Posted 5 August 2020, 2:27 am EST

    Hello Jeff,

    The developers have added support of TestStack.White framework for C1FlexGrid.

    The simple finding of cell didn’t worked because TestStack.White framework tries to find cells by Name predicate which is valid for DataGridView. Name of cell pattern was different in C1FlexGrid. The developers have fixed this case.

    The pattern support is the part of UI Automation implementation. The UI Autimation was not implemented in our controls. The team has added UI Automation and control patterns support for C1FlexGrid. It however works only for 4.5.2 version of C1FlexGrid and only if application target framework is .NET framework 4.7 or later.

    MS controls’ UI Automation and pattern support works by the same rules.

    Also, mentioned support can be disabled by using of accessibility switches.

    For additional info, please, look into https://docs.microsoft.com/en-us/dotnet/framework/whats-new/whats-new-in-accessibility.

    A sample application is uploaded with 2 tests. The first illustrates the simple getting of the cell value and should start work with latest release and the second shows available pattern support.

    Download URL: https://www.dropbox.com/s/06prottcspudtv4/FlexGridTestStackWhiteSampleTest.zip?dl=0

    Regards,

  • Posted 30 September 2022, 11:24 am EST

    This no longer seems to work. I’m using 4.5.20212.513 of C1.Win.C1FlexGrid in a WPF .NET 6 application

  • Posted 2 October 2022, 7:41 pm EST

    Hi,

    Since it is mentioned in the previous response that the support is only added for the 4.5.2 version of C1FlexGrid and only if the application target framework is .NET Framework 4.7 or later, we are anticipating that the issue might be due to the fact that you are using it in a .NET6 WPF application. Although, we are getting in touch with the development team to get more information on this and will let you know the updates as soon as possible.

    [Internal Tracking ID: C1WIN-18290]

    Best Regards,

    Kartik

  • Posted 3 October 2022, 8:39 pm EST

    Hi,

    We discussed this with the development team and as per them, it is not supported since the TestStack.White is deprecated

    (https://github.com/TestStack/White#deprecated---no-longer-actively-maintained)

    and we will not aim to support it. The development team has suggested that you can try to check your case with the tool recommended by MS -

    (https://accessibilityinsights.io/)

    Best Regards,

    Kartik

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels