Telerik blogs

Mixing different frameworks into one automated testing solution can lead to powerful results. Test Studio and Selenium are two frameworks that complement each other well.

For some people it may seem that Test Studio and Selenium are two completely opposite things. Actually, they can work very well together. In two blog posts I'll show you how one can use Selenium inside Test Studio, taking advantage of both frameworks’ strong sides.

Test Studio supports coding in C# and VB.NET. By using them one can easily leverage the capabilities of the .NET framework and Telerik Testing Framework which is in the base of Test Studio. But why not add some Selenium code in the mix? This is how you can do that:

  1. Download the needed Selenium libraries for C# and add the assembly references in your Test Studio project. Yes, Test Studio can use external assemblies!

  2. Create a web test and add a coded step.

  3. Open the code editor in Test Studio.

    By the way, if you haven’t heard, Test Studio will get a huge coding experience enhancement in the major release at the end of March. The code files will be edited separately from the tests, giving you more flexibility in terms of UI arrangement. The code editor is brand new with rich IntelliSense features and other fancy functionalities. In addition to the code files that are associated with tests, you will be able to create standalone code files to be used as helper classes for custom and reusable logic. I will be using this new code editor for the examples here.

  4. Add the needed "using" statements.

    SeleniumUsingStatements

  5. Add some Selenium code into the coded step methods. The example below initializes a new Firefox driver and navigates to a simple test login page. Then we enter credentials into the username and password fields and click the login button. After that there is an assert which verifies that the correct message appears, indicating that we logged in successfully.

    SeleniumSimpleCode

    If you already have Selenium tests, copy them inside Test Studio coded steps. My advice is to copy each Selenium test into one coded step. This way you will have better visibility and maintainability of your tests. It will be also easier to triage the results if there are failures.

  6. Execute your Test Studio tests. If there are failures, you can inspect the failure exception inside the execution log.
Mixing different frameworks into one automated testing solution can give you a lot of flexibility and powerful tooling. It is important to have good understanding of all the involved tools though, if you wish to really make use of their strong sides without adding too much complexity.

Combining Test Studio and Selenium is an interesting matter and I'd be happy to hear some good stories about it. If you are doing it your testing environment, and you are willing to share your experience, please drop me a line.

If you wish to explore Test Studio's features please visit our website. If you have feedback you can leave it in as a comment here or in our Feedback Portal.

Happy testing!

iliyan panchev
About the Author

Iliyan Panchev

Iliyan is a Senior Product Manager at Progress, responsible for the Telerik testing solutions, including Test Studio and JustMock. In the mid ’00s, he started his career in software development as a game tester because he loves video games, and eventually he realized that breaking software is fun. He believes that a good Quality Assurance Engineer should be involved in all phases of the software development process. Iliyan, now as a Product Manager, has a new objective—to relieve the QA engineer of the challenges associated with test automation and help them have more pleasant and rewarding workdays.

Related Posts

Comments

Comments are disabled in preview mode.