Skip to content

Ocaramba – Our Test Framework for Web Applications

Technology

Oct 20, 2021 - 4 minute read

2021 Ocaramba Blog 416X300
Jakub Raczek Senior Automation Quality Engineer

A big supporter of automation — not only tests, also tools for continuous integration and Open Source solutions. He is a co-author of the Ocaramba UI testing framework and DBTestCompare database testing tool. He also specialises in testing data warehouses (SQL Server and Teradata) and Business Intelligence solutions.

See all Jakub's posts

2988 HC Digital Transformation 476X381

Share

Creating a new automated test project for a web application is a time-consuming task. Whenever you want to build a test project from scratch with the Selenium WebDriver, you’ll have to install all the necessary libraries and create classes. In addition, you will need to run tests with a CI tool, as well as prepare and handle the configuration file. As your project grows and spawns more tests, sooner or later you’ll end up creating a framework with some level of complexity. Instead of wasting time on building such a framework from scratch, you can use an existing one, and devote your time only to testing. That’s what we had in mind when we created the Ocaramba framework.

How Does It Work?

We designed Ocaramba (formerly Objectivity.Test.Automation) test framework at Objectivity to propose a common way for creating Selenium WebDriver tests. The framework is written entirely in C#. Thanks to the Ocaramba.Templates extension, within a few minutes, you can create a ready-to-use project for web automated testing in a Continuous Integration tool. You just need to install the extension to Visual Studio and choose one of the templates when creating a new project.

  • Ocaramba.NUnit (.NET Core 3.1)
  • Ocaramba.MsTest (.NET Core 3.1)
  • Ocaramba.NUnit (.NET Framework 4.7.2)
  • Ocaramba.MsTest (.NET Framework 4.7.2)

That’s all you need to do if you want to build a project with a test that can be run quickly. In Ocaramba templates, you will also find test class templates and page objects that can help you speed up the creation of new tests or page object pattern classes.

Ocaramba framework uses Selenium WebDriver and unit frameworks to run tests.

The fact that the syntax of the commands is very similar to the one in Selenium is a key advantage of the Ocaramba framework. The differences are relatively minor, for example: instead of using the FindElement command:

this.Driver.FindElement(By.Id("firstName")).Click();

you must use the GetElement command: 
this.Driver.GetElement(this.button).Click();

An engineer who’s used to writing tests in Selenium can easily switch to Ocaramba. Additionally, the GetElement method has an advantage over FindElement — it automatically waits when locating an element for a specified time set in the configuration file.

Ocaramba provides many more features, such as:

  • Support of continuous integration tools like Azure DevOps, Teamcity, Jenkins et cetera,
  • Capability to run parallel tests, this can speed up your test execution when the number of tests increases,
  • More common locators, such as: "//*[@title='{0}' and @ms.title='{1}']", you can create dynamic locators which can be formatted by passing values into the code,
  • Fixed wait time and conditions for locating elements, when using the GetElement method instead of the Selenium FindElement command,
  • DataDriven tests from xml, csv and Excel files for NUnit as well as xml and csv files for MSTest with examples. You can easily separate test data from the test definition and store data for all tests in a single file, which can simplify managing test data. You can also execute the same tests multiple times for different sets of test data,
  • Possibility to use MSTest, NUnit or xUNIT framework, it’s up to you which unit framework you choose (project templates are prepared for NUnit and MsTest),
  • Readiness to implement Specflow — you can create behaviour-driven development (BDD) tests for your application,
  • Compliance with Chrome, Firefox, Edge Chromium or Internet Explorer — all you need to do to choose a different browser for the test execution is changing a single parameter in the configuration file,
  • Overriding browser profile preferences, passing arguments to browsers, installing browser extensions, loading default browser profiles and headless mode,
  • Extension of Webdriver by additional methods like JavaScriptClick, WaitForAjax, WaitForAngular, et cetera,
  • Support for SeleniumGrid, Cross-browser parallel test execution with SauceLab, TestingBot and Browserstack,
  • Possibility to set Advanced Browser Capabilities and Options,
  • Support of the Verify assert methods without stop tests in case of failure,
  • Measurement of test step times and 90th percentile action times. It can be useful for performance tests for your application,
  • Possibility to take full desktop Selenium screenshots and save page source in the case of failure, which can simplify possible defects analyses,
  • Visual Testing – for example, comparing browser screenshot of the element to the expected baseline,
  • Logging with NLog, EventFiringWebDriver logs,
  • In Firefox and Chrome, files are downloading automatically, verification whether the files were downloaded,
  • Possibility to send SQL or MDX queries,
  • Possibility of debugging framework installed from a NuGet package with sourcelink,
  • AngularJS support,
  • Instruction on how to run Ocaramba tests with a Docker container.

If you need more detail on using any of these features, feel free to visit the wiki tab on Ocaramba’s GitHub page.

Important Links

Technology used

  • Selenium
  • .NET Core
  • .NET Framework
  • Unit test frameworks: MSTest, NUnit, XUnit
  • Specflow BDD-Framework

Ocaramba in numbers

  • Over 250 thousand downloads from nuget.org, (Ocaramba, former Objectivity.Test.Automation),
  • 18 contributors on github,
  • 45 releases on github,
  • Over 500 downloads of Ocaramba.Templates.

Ocaramba in Objectivity’s projects:

  • Thousands test cases automated in dozens of projects

Summary

Thanks to using the Ocaramba framework and the extension to Visual Studio Ocaramba.Templates, you can create a fully functional test project ready-to-use with CI tools in just a few clicks. In addition, the use of a ready-made framework will allow you to start working on tests faster. It also lets you save time you’d otherwise spend on developing your own framework, and instead focus only on creating automated tests, which is what your teams and clients are often most interested in.

2988 HC Digital Transformation 476X381
Jakub Raczek Senior Automation Quality Engineer

A big supporter of automation — not only tests, also tools for continuous integration and Open Source solutions. He is a co-author of the Ocaramba UI testing framework and DBTestCompare database testing tool. He also specialises in testing data warehouses (SQL Server and Teradata) and Business Intelligence solutions.

See all Jakub's posts

Related posts

You might be also interested in

Contact

Start your project with Objectivity

CTA Pattern - Contact - Middle

We use necessary cookies for the functionality of our website, as well as optional cookies for analytic, performance and/or marketing purposes. Collecting and reporting information via optional cookies helps us improve our website and reach out to you with information regarding our organisaton or offer. To read more or decline the use of some cookies please see our Cookie Settings.