PDF controls
A control is a screen element in your application that you want to test. For example, a text box or a table. This topic lists all
Text
To verify text in a PDF document, enter the expected text and use action mode Verify.
Images
To verify that an image exists in the PDF document, enter .Exists==True and use action mode Verify.
Tables
To verify text in a table cell, follow these steps:
-
Identify the cell as described in Table.
-
Enter the expected text into the test case and use action mode Verify.
Anchor controls
Anchor controls are useful when you try to steer controls that don't always appear in the same absolute position in your PDF. If these controls ("target controls") always appear in the same relative position to another element ("anchor control"), you can use the anchor control for identification.
Tosca Cloud is serious about finding the right anchor control: There must be a 99% match for image anchors and a 100% match for text anchors. Sometimes, this may lead to issues. For example, if you use optical recognition for text, Tosca Cloud may interpret the number 0 as the letter O.
In this case, you can configure a lower level of accuracy. To do so, create a transition parameter for the module attribute with the anchor, with the name Accuracy and a value between 0 and 100. This value represents the new accuracy percentage for the module.
Edit an anchor control
Once you have turned an area into an anchor control, right-click on it to edit it. You have the following options:
-
To change the type of the anchor control, select Text Anchor or Image Anchor.
-
To add a target control to the anchor control, select Add/Remove target controls and select the target control that you want to add.
-
To remove a target control from the anchor control, select Add/Remove target controls and select the target control that you want to remove.
Make an anchor control uniquely identifiable
An anchor control has to be uniquely identifiable, otherwise Tosca Cloud can't find the right anchor at runtime.
You can recognize anchor controls that aren't unique by their orange highlight in the list of controls. To make an anchor control uniquely identifiable, redraw it.
Repetitive area controls
Repetitive areas are useful when an element appears in the same area on multiple pages of your PDF.
By default, Tosca Cloud checks all pages of your PDF. If you want to exclude certain pages, use the module attribute Repetitive Area Exclusions:
-
Adapt the module, if you want to exclude the same pages in all test cases where you use the module.
-
Adapt the test step you create from the module, if you only want to exclude certain pages in this particular test case.
To adapt either the module or the test step, change the value of Repetitive Area Exclusions. This table lists all possible values:
Value |
Description |
---|---|
Odd numbered pages |
Excludes all odd numbered pages. |
Even numbered pages |
Excludes all even numbered pages. |
<positive integer> |
Excludes all pages with this page number. You can also enter multiple pages or ranges. For example, 1; 3-6; 9 excludes pages 1, 3, 4, 5, 6, and 9. |