Scan PDF files

Your application has various controls, which are elements that Tosca interacts with when you run your tests. To make this possible, you must first scan your application. This gets the necessary technical data into Tosca.

This topic explains how to scan PDF documents which you need for the following use cases:

  • You want to test text, image, or tables in a PDF file.

  • You want to exclude areas from a PDF comparison.

In all other cases, such as checking for broken links, you'll work with the Standard subset instead. For more information, check out PDF Modules.

Start the scan

To start the scan, follow these steps:

  1. Right-click a Module folder and select Scan from the context menu, or use the dynamic menu Modules and select  Scan->PDF. Alternatively, you can use the keyboard shortcut Ctrl + Shift + P.

  2. Select the PDF file that you want to scan and select Open.

Add a content preview

You can make sure your scanned controls are accurate by checking the Content Preview of the PDF Scan. The Content Preview shows exactly what you've selected for your control. You may need to add it manually.

By default, the PDF Scan window shows the following:

  • The PDF file.

  • The names and types of the PDF controls you choose during the scan.

To display the content of a chosen control, select Show Content Preview in the ribbon menu.

This helps make sure your selection has the right content. It also gives you access to the Force optical recognition option, in case Tosca doesn't properly recognize a control's content.

Additional options in the scan interface

The PDF Scan menu also offers the following options:

Option

Description

Zoom

Change the zoom level of the PDF View.

 Zoom Fit

Enlarge the scanned PDF to fit the PDF View.

Show scanned areas

Show or hide the scanned areas in the PDF View.

Select Document Language

Select the language of the scanned PDF. The PDF Scan uses this language for optical character recognition (OCR).

Choose your controls

There are different ways to define the PDF controls you want to add to your Module:

  • Define a control by its absolute position.

  • Define a control by its relative position to another element. This is useful if a PDF element doesn't have an absolute position, but always appears in a specific position to another PDF element.

    Let's say you're testing invoices and want to verify that Net price shows the right price. Depending on the length of the itemized list, Net price might appear further up or down on the page. It doesn't have an absolute position. However, it always appears right above Gross price. So it always appears in a specific position relative to another element.

  • Define repetitive areas. This is useful if an element appears in the same area on multiple pages of the document.

    Let's say you want to verify that the copyright notice appears at the bottom of all pages. Instead of defining the control separately for every single page, you can create a repetitive area for the entire document.

Choose your use case:

Edit controls during the scan

You can edit your controls during the scan:

  • To select an area, select it in the PDF View or on the list of controls.

  • To jump to a control in the PDF View, double-click the control on the list, or use the Jump icon.

  • To change the name of a control, double-click its name.

  • To change the size of an area or move it, manipulate the rectangle in the PDF View.

  • To redraw a control, select the Redraw icon in the list of controls.

  • To delete a control, select the Delete icon in the list of controls, or right-click the area in the PDF View and select Remove this control from the context menu.

Rescan

If you want to add or change controls in your Module, rescan your PDF file. Please note the following limitations:

  • You can't delete controls during the rescan.

  • You can't change the control type during the rescan.

To rescan, right-click the Module that you want to change and select Rescan from the context menu, or press Ctrl + Shift + R..

What's next

Now that you have your PDF Modules, you can start creating PDF TestSteps.