We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Can CodedUI testing be performed in the TreeViewAdv?

Yes, the Coded UI Test (CUIT) in the TreeViewAdv can be used for testing purposes.


The Essential Tools TreeViewAdv control has basic level of Coded UI automation testing support. The Coded UI functionality can be tested from VS2010 or above with Ultimate or Premium version. TreeViewAdv supports Coded UI from Syncfusion Essential Studio version v9.1.0.20. Refer to the following steps to provide Coded UI support in the TreeViewAdv.


Create a Coded UI test project:

CUIT should contain the coded UI test project. If your application does not contain the CUIT project, create a new project. In the Solution Explorer, on the shortcut menu of the solution, choose Add, New Project, and then select either Visual Basic or Visual C#. Next, choose Test, Coded UI Test.

In case, the Coded UI test project does not appear on Visual Studio, you may be using the version that does not support CUIT. To create CUIT, you need to use Visual Studio Enterprise edition.


Figure 1: Creating Test Application.

Adding Coded UI test file:

The CUIT file is generated automatically, when creating the Coded UI test project. To add another test file, choose shortcut menu of the CUIT project, point to add, and then choose Coded UI test.


Figure 2: Adding “Coded UI Test” file to the test project

  1. In the Generate Code for Coded UI Test dialog box, choose the Record actions as shown in the following image.



Figure 3: Recording option to generate code for Coded UI Test

  1. After choosing the option Coded UI Test Builder (UIMap) is shown at the BottomRight of the window.
  2. Choose start recording option from the UI Map to record the testing. You can also pause the recording while testing the application.



Figure 4: Start recording from UIMap



Figure 5: Pause recording from UIMap

  1. The recorded steps are shown by using the UIMap or by pressing Alt + S key.
  2. To delete actions that you had recorded by mistake, choose Edit Actions.
  3. To generate code that replicates your action, choose the Generate Code icon and type a name and description for your CUIT method.



Figure 6: Recorded steps shown in UIMap

  1. After completion of the testing process, choose the Generate code option from the UI Map to generate the code in the test project. The generated code replicates your actions.



Figure 7: Generate code in UI Map'

  1. Choose the required method and description for code generation.



Figure 8: Generate code window for UI Map


Testing application with the Generated Coded UI Tests:

You can test the application with the generated CUIT method.

  1. Add a TestMethod called CodedUITestMethod1.


The following code example demonstrates the same.




  1. Build and run the application that has already been configured. You can also open the CUIT builder with the following steps.
  2.  Right click the body of the CodedUITestMethod and then select Generate Code for Coded UI Test -> Use CUIT builder as shown in the following screenshot:



Figure 9: Opening Coded UI Test Builder



Figure 10: Coded UI Map



Figure 11: Assert window for TreeViewAdv in Coded UI Test Builder

Sample Links:

C#: TreeViewAdv-CodedUISupport_C#

VB: TreeViewAdv-CodedUISupport_VB

Article ID: Published Date: Last Revised Date: Platform: Control:
5410 09/04/2015 09/04/2015 WinForms TreeViewAdv
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Please sign in to access our KB

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon