Skip to main content

Business applications, like Oracle Cloud, have unique constraints and considerations.

If you are a tester working with such apps, you must be familiar with custom and dynamic controls. While these controls add powerful capabilities to your app, they have their challenges for automation and debugging.

We all relate to this, don’t we?

We all start crafting our test automation scripts, feeling like a test automation ninja.

But suddenly, BAM !!

A blocker wall !!

A custom control, a complex UI element, or a dynamic tag will now throw your carefully planned test automation into a blocked state.

You are certainly not alone here.

Tricentis Tosca has a secret weapon to deal with such custom controls.

This weapon allows you to wrestle and tame even the most stubborn elements in your Oracle Cloud Apps, ensuring your tests run smoothly and deliver the seamless value that your business craves.

In this article, we will be diving headfirst into the advanced world of Tricentis Tosca uncovering various capabilities and tactics that it offers to handle these complex controls in any of your Oracle cloud apps.

Tricentis Tosca: Automation Hub for Experts

Before we talk about the challenges and solutions, let's have a look at Tosca itself.

Tosca is a decade-old one-stop solution for all things test automation. It’s a centralized automation hub, consisting of a set of tools that helps you build, manage, and execute your test scripts easily.

Here is a list of key components of Tricentis Tosca:

  1. Tosca Commander: The graphical user interface (GUI) of the Tosca test suite, where all test suites reside. This is like a central hub to create, edit, and manage your test scripts.

You can then analyze the results. Feeling like a true test automation commander, already?

  1. Tosca Xscan: Think of Xscan as your digital detective.

It will scan any application under test (AUT), and then gather technical details of all its elements. This lets Tosca identify and interact with each screen element with precision, robustness, and accuracy.

  1. Tosca Executor: Once the test cases are prepared, the Executor takes control.

Think of it as a launchpad that executes your test cases across different environments to ensure everything works as expected.

  1. Test Repository: A centralized vault for storing and managing all kinds of test-related artifacts.

Tosca stores and keeps all of its test cases, test data, and other essential testing elements in this repository. This acts as a library where you can easily find and retrieve your testing-related data and other materials.

Complex Controls: The Oracle Cloud App Challenges

In this article, let’s take the example of Oracle Cloud Apps for UI-based testing.

These cloud-based applications are known for their powerful and diverse features. They have some real challenges for your test automation efforts.

A common challenge is dealing with complex controls.

Let’s consider a scenario where you have to select a value from a dropdown list of options. These scenarios are quite common for testers as part of their daily work.

When it comes to applications like the Oracle Fusion Cloud app, this simple-looking dropdown menu ( or ComboBox) comes nestled inside a table which might be nested inside another tag. Here, multi-level nested hierarchy is quite common.

Most traditional automation tools struggle to identify and interact with this control in an accurate and robust manner. This leads to flaky scripts and false positives.

Managing these test scripts can lead to a lot of distortion and distraction from the actual testing work that’s needed for the job.

In the upcoming sections, we will see how can we solve such issues using Tricentis Tosca.

Tosca’s Custom Controls: The Secret Weapon

Let's discuss a game changer, Custom Controls, the feature making Tosca stand out.

It empowers an automation tester to deal with unique UI elements that traditional automation tools are unable to handle.

Tosca’s custom controls allow you to wrap complex user interface (UI) widgets (like chart libraries, calendars, dropdowns, and grids) into Tosca’s standard UI elements.

These custom controls are based on special, custom DLL components. They can tackle everything from non-standard controls that are built in-house to third-party widgets to elements with dynamic behavior.

This is how custom controls create magic for your test automation:

  • Efficient Automation: Have complex controls that the system is struggling to identify? Let custom controls create a special recipe just for that dropdown. Once it has been created, Tosca knows exactly how to interact with it.
  • Precise Control Identification: Pinpointing to the right element, made easy.

Custom controls let you also define specific properties, ensuring your tests target exactly what they need to. You can practically teach and control the way how Tosca should interact with any specific element.

  • Reusable Awesomeness: Build custom controls once, and use them everywhere across different test cases and suites. This will save you time while reducing maintenance effort, and keeping your scripts clean and scalable.
  • Integration Powerhouse: Custom controls seamlessly integrate with the entire Tosca ecosystem, making them an even more powerful tool in your testing arena.

Tosca's Custom Control Architecture

Tosca has a multi-layered approach to manage custom controls.

Let us have a look at each layer:

Fig 2: Tosca’s Custom Control Architecture
  1. Technical Layer:
    • the foundation layer.
    • this bottom layer contains specific technical components.
    • the layer that handles the nitty-gritty details of interacting with different technologies and components.
    • here, Tricentis Tosca translates the HTML tag on your test application’s screen (for example: <table> tag) into a C# class.
    • it lays the foundations for programmatic manipulation of the control.
  2. Adapter Layer:
    • a bridge between the technical layer and the topmost presentation layer.
    • includes adapters like HtmlTableAdapter and AnyTechnologyTableAdapter.
    • these adapters translate interactions from the technical layer into a format that the presentation layer can interpret.
    • it takes the technical layer and wraps it in a way that allows you to interact with the control using functions.
    • as an example, imagine converting a <div> tag into a button. The technical layer would handle the underlying HTML, while the adapter layer lets you interact with it as a button.
  3. Presentation Layer:
    • this top layer represents the tester’s view and interactions done to navigate through the system under test.
    • includes various UI elements such as ComboBox, Button, Container, Calendar, EditBox, etc.
    • final output objects to be used in the test automation script can be seen in this layer.

Putting Theory to Action: Solving the Custom Control Mystery

Presenting, a step-by-step demonstration of how you can utilize Custom Control feature for your use cases.

To illustrate this, we will use the Oracle Fusion Cloud app.

Pre-requisite: You should have the “Tosca Automation” Extension installed on your browser.

  1. Open the Oracle Cloud Application on the browser.
  2. Inspect the Application to find the Unique Identification property on the control Status ComboBox.

     

       3. Open Microsoft Visual Studio.

  1. Click on “Create a new project”.

     

       5. Search for Class Library.

  1. Select Class Library (.NET Framework) and Click Next

     

  1. Write Project Name. For this demonstration, we will set the project name as : “FancyComboBox_Customization”.
  2. Select Framework 4.8.
  3. Click Create.

     

  1. Right click on References under your project in Solution Explorer.
  1. Click on Add Reference
  1. Click on Browse
  1. Go to the path “C:\Program Files (x86)\TRICENTIS\Tosca Testsuite\TBox

Note: If you have installed the Tosca Testsuite in a different folder on your file system, replace the above path with your own custom path.

  1. Search for the following references and add them to the project-
  • Tricentis.AutomationBase
  • Tricentis.Automation.HtmlEngine
  • Tricentis.Automation.Interaction
  • Tricentis.Common.MiscHelper
  1. Click OK.

These references should now be available in your project references.

  1. Expand Properties and click on AssemblyInfo.cs.
  1. Add the following in a different line (refer to the screenshot below):

tassembly: EngineId("Html")]

  1. Create a new class for your control adapter. For this example, we are creating an adaptor for a combo box and thus renaming it to “FancyComboBoxAdapter”.

     

The above code interacts with a ComboBox from the DOM in Oracle Cloud Apps using Tosca Custom Controls.

The FancyComboBoxAdapter class validates the ComboBox's class name and provides a method to open it by clicking the dropdown icon.

This facilitates reliable automation of ComboBox interactions.

  1. Now, let’s add another adapter class for storing the list of items that are stored in the combo box. For demonstration purposes, we will set the class name as, “FancyComboBoxItemAdapter”. Refer to the code snippet below:

     

The above code enables interaction with Combo Box values in the Oracle Cloud Apps using Tosca Custom Controls.

In this code, the Class FancyComboBoxItemAdapters extends AbstractHtmlDomNodeAdapter and implements IListItemAdapter, validating and managing ComboBox elements.

It captures selected item values and triggers changes, enabling efficient automation.

  1. Now, Add a folder in your project and rename it to Controller. The controller classes are created to define an interface between the Adapter Classes (Ex: FancyComboBoxAdapter and FancyComboBoxItemAdapters) and Tricentis Tosca.
  1. Within this Controller folder, add a class file and rename it to “FancyComboBoxAdapterController”. Now, reference the code snippet below:

     

Here, FancyComboBoxAdapterController, connects the technical and presentation layers to enable complex control testing on the Oracle Cloud Apps.

It extends ListAdapterController, resolves associations for items, and retrieves ComboBox items, streamlining ComboBox automation.

  1. Now, build the solution.
  2. Copy the “<Project Name>.DLL” file from the output path available inside bin > debug.
  3. Place this DLL file in C:\Program Files (x86)\TRICENTIS\Tosca Testsuite\TBox.
  4. Restart Tosca Commander on your system now.
  5. Open Tosca Project that you were working on.
  6. Go to Module Folder.
  7. Scan the Application using XScan.

     

  1. Select the ComboBox Control.
    Fig 3: After adding .DLL for Custom Control
    Fig 4: Before adding .DLL for Custom Control

     

  1. Save the Module.
  2. Drag the module and drop it to the test.
  3. Whoa! That’s all!

Now you can run the TestCase from scratchbook runner.

Summary

Tricentis Tosca is a versatile and powerful tool for automating tests, especially when dealing with complex controls in Oracle Cloud Apps.

Its custom control feature is a game-changer, that enables testers to handle components that are difficult to identify or interact with using traditional methods. This customization capability makes Tricentis Tosca adaptable to diverse environments and highly flexible.

Here's a quick recap of the key takeaways:

  • Custom controls let you overcome challenges with complex UI elements.
  • Tricentis Tosca's layered architecture breaks down controls into manageable parts.
  • Building custom controls in C# provides precise control and reusability.

To utilize custom controls in Trcientis Tosca, you'll need to:

  1. Install the Chrome extension: This activates the XScan feature for element identification.
  2. Develop custom controls in C#: These controls are saved as .DLL files.
  3. Integrate controls into Tricentis Tosca: This allows testers to leverage them within their test cases.

Complex controls in Oracle Cloud Apps can easily be resolved with Tricentis Tosca and its robust custom control feature lets you conquer these challenges and achieve seamless automation.

Be the first to reply!

Reply