Tips and Tricks

Tools for Tuesday

While we hope Visual Assist is your favorite dev tool, we know we can’t (and won’t) do everything for you. As we continue developing solutions, we’ll also showcase tools or tips for other problems you may face in other parts of development. This week, you’ll hear from our friends at Ranorex:

How to continue to test in Visual Studio in a post Coded UI world. 

Producing powerful on-time releases demands high-quality code and thorough testing. This is why developers have been encouraged to continuously inspect their code for errors and to shift their testing left.  Visual studio is far and away the most popular IDE on the planet with an estimated market share of 39%, and there are some great code inspection tools that extend Visual Studio functionality out there, but what about left-shifted test automation? 

For users of Visual Studio, Coded UI facilitated a shift-left approach to development by enabling automated UI-driven functional testing from within the IDE. However, earlier this year Microsoft announced that Coded UI was deprecated. Visual Studio 2019 would be the last version to support Coded UI.

Does this mean that left-shifted developers and technical testers are bereft of a testing framework that operates from within Visual Studio? The answer my friends is “not on your nelly”. The Ranorex testing framework provides an API for C# and VB.Net that completely replaces Coded UI.

Migration from Coded UI to the Ranorex testing framework is as easy as one, two, three. Once you have downloaded and installed Ranorex Studio simply follow the instructions below:

1. Create a new Visual Studio project 

Open Visual Studio, go to File > New Project. Next, you will need to select .Net Framework 4.5.2 or higher, you will be prompted to choose your programing language, you can select either C# or VB.Net. All that is now left to do in this first step is to select Console Application and hit OK.   

New project window

2. Add Ranorex core assemblies as references

To ensure a seamless migration away from Coded UI you will next need to add the Ranorex core assemblies. To do so navigate to the project’s Solution Explorer, right mouse click on the References Folder and select Add Reference… 

Solution explorer

Click browse and then navigate to the Bin folder of your Ranorex installation, (the default location is C:\Program Files (x86)Ranorex Bin). 

Add the following:

  • Ranorex.Bootstrapper
  • Ranorex.Common
  • Ranorex.Core
  • Ranorex.Core.Resolver
  • All Ranorex.Plugin assemblies
https://miro.medium.com/max/846/1*H3t63DTmK-_Gg9AITVokEA.png

Set the Copy Local option to False for all Ranorex assemblies except for Ranorex.Core.Resolver

3. Over to you 

Start writing code and continue with left-shifted testing in Visual Studio. 

Before you go

Not only are you able to continue to test in your preferred IDE you can also benefit from the best object recognition on the market. Ranorex Spy is the tool developers and technical testers love. Use it to analyze your AUT, its element structure, available object properties and attributes, and build the most robust and reliable XPaths for use in Visual Studio.

Be in full control of your XPaths. Increase or decrease dynamism in line with the complexity your tests require. Add variables to your XPaths and customize how you uniquely identify UI elements even when testing mixed technology applications. 

You can also benefit from all the functionality associated with Ranorex. Have a better understanding of failed tests with fully customizable reports. Get built-in object repository access and organize your tests in logical hierarchical structures. 

Conclusion

Left-shifted developers and technical testers who have used Coded UI need not mourn its passing, rather they should see the deprecation as an opportunity to increase the speed and quality of their releases. The Ranorex testing framework offers an API that completely replaces Coded UI, has far superior object recognition, and increased functionality. But don’t take my word for it download you full featured 30-day free trial and find out for yourself. 

Related posts
Tips and Tricks

Everything you need to know about code inspections

Leave a Reply

%d