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.
Unfortunately, activation email could not send to your email. Please try again.

Can CodedUI testing be performed in the TreeViewAdv?

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

TreeViewAdv:

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.

cid:image001.jpg@01D0DB50.A2432380

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.

cid:image002.png@01D0DB50.A2432380

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.

 

cid:image003.png@01D0DB50.A2432380

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.

 

cid:image011.png@01D0DB81.EEFE1F00

Figure 4: Start recording from UIMap

 

cid:image016.png@01D0DB80.0570CDC0

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.

 

cid:image015.png@01D0DB80.809B90C0

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.

 

cid:image017.png@01D0DB80.0570CDC0

Figure 7: Generate code in UI Map'

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

 

cid:image013.png@01D0DB73.D4937560

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.

C#

VB

 

  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:

 

cid:image010.png@01D0DB50.A2432380

Figure 9: Opening Coded UI Test Builder

 

cid:image011.png@01D0DB50.A2432380

Figure 10: Coded UI Map

 

cid:image012.png@01D0DB50.A2432380

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 Windows Forms TreeViewAdv
Did you find this information helpful?
Add Comment
You must log in to leave a comment

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.