Scanning Web Application Using Tosca Scan

Tricentis Tosca is a Continuous Testing platform that accelerates testing to keep pace with Agile and DevOps, accelerates testing with a low-code/no-code approach.

Creating modules using Tosca Scan:

Each time Tosca scans visual or non-visual test objects, it creates Modules that contain all technical information you needed to steer controls. Test objects are scanned via Module folders in the Modules section.

  • Right-click a Module folder or use the dynamic menu Modules and scan Scan.
Creating modules using Tosca Scan
  • The Scan drop-down menu offers different scanning options. You can select which interface you want to use:

Application – To scan graphical user interfaces (GUIs) such as DotNet Winforms, Browser, JavaFX, or SAP applications.

API –Tosca API Scan enables you to test your application programming interfaces (APIs).

Mobile -To scan Android and iOS mobile applications with the Tosca Mobile Engine 3.0, select the option Mobile.

PDF-To scan PDF files with the Tosca PDF Engine 3.0, select the option PDF.

Host-To scan Host emulator sessions with the Host Engine 3.0, select Host.

More – To scan Salesforce applications, JSON or XML files, classic modules for GUI & also to steer the browsers on remote machines or on your local machine.

  • Tosca XScan automatically selects the engine with which it scans the application.

Refresh displays the applications and windows opened while scanning. Tosca XScan ignores blacklisted applications and does not display them in the Select Application screen.

select applications

Adding Extensions to the Chrome Browser:

The Tosca extension for Google Chrome must be installed to automate test execution with the XBrowser Engine 3.0

Adding Extensions to the Chrome Browser
Tosca Automation Extension for chrome

Extension successfully added to Chrome browser as below. Tosca extensions are available for Chrome, Firefox, and Edge browsers.

Tosca Automation Extension for chrome 2

Identifying test object:

In Tosca XScan, you can identify controls in your test application by using multiple identification methods. The identification of controls by their properties is the default method in Tosca XScan.

Tosca XScan

However, if your controls cannot be identified uniquely. Identify by Anchor/Image/Index can be used.

Identify by anchor

Select on screen icon can be clicked if specific test objects need to be inspected instead of scanning all the objects available in the web page.

Identify by Anchor:

  • Let us take the demo web shop application to see the purpose and the use of identify by Anchor.

We have scanned the list of categories as test objects and the objects doesn’t have unique properties to identify using properties by InnerHTML, InnerText and Tag.  We could also see a warning in the bottom of the scan window as “The selected item is not unique”

Demo web shop

In this case, we must find a reference test object that has unique property to use it as Anchor. Filtered Items option can be used to see more detail of the tree on the screen.

demo web shop application

Object “Categories” can be taken as an Anchor as it can be identified as unique object with the properties OuterText and Tag as below.

outer text

Let us check out the steps to use Identify by Anchor.

  • Click on the scanned object “Book” and select the option Identify by “Anchor”.
Anchor

The identify by Anchor window is displayed on the right side. Drag and drop anchor object “Categories” to the test object “Books”

Anchor window

The Anchor object “Categories” is now mapped to the test object “Book” and Anchor icon is displayed.

Anchor icon

By following the same steps rest of the objects are identified by Anchor to steer in Tosca.

Anchor to steer in Tosca

Identify By Index:

  • If a selected control does not have a unique ID, select an index to be used upon test execution to identify the control.
unique ID

The index is calculated dynamically and based on already selected identification criteria.

selected identification criteria

Identify by Image:

Let’s take the example of object Search.

Select the option Identify by Image.

Select the option Identify by Image

Window for the Identify By image opens on the right side. Click on the plus icon to locate the object by image.

Window for the Identify By image
  • Position the object using drag and drop to define the area of the object to identify and click on save.
Position the object using drag and drop to define the area of the object

The upper section of the window shows the control’s image, and the lower section shows the image used for identifying the control area. The images are identical here since the image of the control is used for identification purposes.

The upper section of the window shows the control's image

Tosca also allows several images to be stored for a control, for example if the shape of the search button is subject to changes according to the context. Identification requires that one of the stored images is found.

shape of the search button is subject to changes

Texts of image-based controls which are found via images can be verified by using either optical character recognition (OCR) or the UIA interface. Tosca uses the UIA interface by default for verifying texts

Leave a Reply

Your email address will not be published. Required fields are marked *