Can CodedUI testing be performed in the TreeViewAdv?

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

Create a Coded UI test project:

CUITshould contain the coded UI test project. If your application doesnot contain the CUITproject, 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 usingthe versionthat does not support CUIT. To create CUIT, you need to use Visual StudioEnterprise edition.

Figure 1: Creating Test Application.

Adding Coded UI test file:

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

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

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

After choosing the option Coded UI Test Builder (UIMap) is shown at the BottomRight of the window.

Choose start recording option from theUI 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

The recorded steps are shown by using the UIMap or by pressing Alt + S key.

To delete actions that you had recorded by mistake, choose Edit Actions.

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

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 codereplicatesyour actions.

Figure 7: Generate code in UI Map'

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.

Add a TestMethod called CodedUITestMethod1.

The following code example demonstrates the same.

C#

VB

Build and run the application that has already been configured. You can also open the CUIT builder with the following steps.

Right clickthe body of the CodedUITestMethod and then select Generate Code for Coded UI Test -> Use CUITbuilder as shown in the following screenshot: