Adobe PDF documents support
IBM® Rational® Functional Tester supports testing of Portable Document Format (PDF) read-only files created for Adobe Reader versions 7.0, 8.0, 9.0, 10.0, and 11.0. (Adobe Reader 11 is the last supported version of the Reader application.) You can test PDF files that are displayed in a browser or in the stand-alone Adobe Reader application. A functional test script that is recorded for files that are displayed in the stand-alone Adobe Reader application can be played back when the file is displayed in a browser and vice-versa, provided that the script is recorded for document controls only. Support for Adobe PDF requires Visual C++ 2013 or higher.
Rational® Functional Tester supports testing of PDF files by either interacting with specific document controls or through Reader controls.
The level of granularity that Rational® Functional Tester supports depends on the way the PDF file is designed. For example, if the entire page of a PDF file is designed to contain one text object only, the verification point highlighter captures only the page-level contents and does not access the content inside the page.
Cross-compatibility of testing PDF read-only files is possible only for document controls and not Reader controls. For example:
- Stand-alone Reader and browser: A test script that is recorded on a PDF file that is opened in the stand-alone Reader can be played back on a PDF file opened in browser, provided that the script is recorded for document controls only.
- Reader 7.0, 8.0, 9.0, 10.0 and 11.0: A test script that is recorded on a PDF file that is opened in the stand-alone Adobe Reader 7.0 can be played back on a PDF file opened in Adobe Reader 8.0 and so on, provided that the script is recorded for document controls only. Additionally, a functional test script that is recorded for files that are displayed in the stand-alone PDF Reader can be played back when the document is displayed in a browser and vice-versa, provided that the script is recorded for document controls only, and provided that the regular expression is used for the top-level window.
- When you record on the Reader toolbar buttons in Adobe Reader 10.0 and 11.0, the action is recorded as click(atPoint(x,y)).
- When you record on a PDF file that is opened in an Internet Explorer browser, you must first
record actions in the browser and then begin the recording on the PDF file.Note: Only the Internet Explorer browser supports the recording of a PDF file.
- Playback fails when only the find() API is used to locate objects. As a workaround, click the captured object first and then play back.
- Page
- Table
- Text
- Link
- Outline Tree
- Graphics
- Document
- Button
- Check box
- Toggle button
- Text box
- Combo box
- Setting preferences for Adobe Reader 7.0
- Open Adobe Reader 7.0.
- Click .
- Click Next on the Accessibility Setup Assistant page.
- Select Fit page as the Default display zoom in Screen 2 of 5, and click Next.
- Clear Confirm before adding tags to documents in Screen 3 of 5, and click Next.
- In Screen 4 of 5:
- For Page mode setting, select Deliver currently visible pages.
- For Document mode setting, select Deliver the entire document at once .
- Click Next.
- In Screen 5 of 5, select Display PDF documents in the web browser.
- Click Done.
- Click in Adobe Reader.
- Click the Page Display category and select Single Page as the Default Page Layout, and click OK.
- Setting preferences for Adobe Reader 8.0, 9.0, 10.0 and 11.0Note: For version 10.0, ensure that you disable protected mode before you set the preferences. For instructions, see the procedures Disabling the protected mode for Adobe Reader 10.0 and Disabling the protected mode for Adobe Reader 11.0. For version 11.0, ensure that you disable Enhanced Security. Under , go to Security(Enhanced), and uncheck Enable Enhanced Security.
- Open Adobe Reader.
- Click .
- Click Next twice.
- Clear Confirm before tagging documents in Screen 3 of 5 and click Next.
- In Screen 4 of 5:
- For Page mode setting, select Only read the currently visible pages in the Page vs Document field.
- For Document mode setting, select Read the entire document at once in the Page vs Document field.
- Click Next.
- In Screen 5 of 5, select Display PDF documents in the web browser.
- Click Done.Note: Verify that Click to show one page at a time button at the top toolbar of the Adobe Reader is selected for recording and playing back.
- Disabling protected mode for Adobe Reader 10.0
- Click .
- Click General in the Categories list.
- Clear the Enable Protected Mode at startup check box.
- Click OK, and restart the reader.
- Set the accessibility options as described in the Setting preferences for Adobe Reader 8.0, 9.0, 10.0 and 11.0 procedure.
- Disabling protected mode for Adobe Reader 11.0
- Click .
- Click Security (Enhanced) in the Categories list.
- Clear the Enable Protected Mode at startup check box in the Sandbox Protection Area. When prompted to confirm your choice, click OK.
- Click OK, and restart the reader.
- Set the accessibility options as described in the Setting preferences for Adobe Reader 8.0, 9.0, 10.0 and 11.0 procedure.
- Setting the Rational® Functional Tester
script assure values
- Open Rational® Functional Tester, and click .
- In the Preferences window, expand , and then click Script Assure.
- Click Advanced.
- Specify the following values on the Script Assure page:
- Maximum acceptable recognition score:
5000
- Last chance recognition score:
10000
- Ambiguous recognition scores difference
threshold:
1000
- Warn if accepted score is greater than:
5000
- Maximum acceptable recognition score:
- When you open a new file in Adobe Reader, click the PDF file a few times after the recorder starts, till a meaningful recording statement is seen in the recording monitor. These clicks are required for the Reader to process the file.
- Only document verification points are supported in the document mode setting. A verification point can be taken after the mandatory click in the file. Any clicks on the PDF document in document mode setting while recording are ignored and no code is generated.
- Use the Page mode setting for larger documents.
- To take data verification point on a large document in Document
mode, follow these steps:
- Create the following registry key:
- HKEY_LOCAL_MACHINE\SOFTWARE\Rational Software\Rational Test\8\Options
- Create a new DWORD variable
InvocationTimeout
. - For documents of 70 pages or more, specify the timeout value of
8*60*1000
milliseconds. - Restart Rational® Functional Tester and restart Adobe Reader.
- Perform the clicks on the PDF file until this message is generated: "Ignoring the click on PDF document in document mode setting".
- Take the data verification point.
- Create the following registry key:
- If a particular control in the PDF file spans over two or more lines, the highlight rectangle covers all the lines in that control location. Other controls might fall in the highlight rectangle. But when a verification point is taken on the control that spans over two or more lines, any other controls that fall within the screen rectangle are not considered.
- You might not be able to test the PDF files correctly if the font of the letters in the PDF file is not available or installed on the computer.