Adobe PDF documents support

HCL OneTest UI 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.

HCL OneTest UI supports testing of PDF files by either interacting with specific document controls or through Reader controls.

The level of granularity that HCL OneTest UI 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.
Note: PDF 9.0, 10.0 and 11.0 file testing support:
  • 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.
HCL OneTest UI provides support for testing PDF files that contain the following document controls:
  • Page
  • Table
  • Text
  • Link
  • Outline Tree
  • Graphics
  • Document
HCL OneTest UI provides support for testing PDF files that contain the following Reader controls:
  • Button
  • Check box
  • Toggle button
  • Text box
  • Combo box
Prerequisites: Before you start testing PDF files, you must set the Adobe Reader preferences and the HCL OneTest UI script assure values.
  • Setting preferences for Adobe Reader 7.0
    1. Open Adobe Reader 7.0.
    2. Click Document > Accessibility Setup Assistant.
    3. Click Next on the Accessibility Setup Assistant page.
    4. Select Fit page as the Default display zoom in Screen 2 of 5, and click Next.
    5. Clear Confirm before adding tags to documents in Screen 3 of 5, and click Next.
    6. 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 .
    7. Click Next.
    8. In Screen 5 of 5, select Display PDF documents in the web browser.
    9. Click Done.
    10. Click Edit > Preferences in Adobe Reader.
    11. 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.0
    Note: 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 Edit > Preferences, go to Security(Enhanced), and uncheck Enable Enhanced Security.
    1. Open Adobe Reader.
    2. Click Document > Accessibility Setup Assistant.
    3. Click Next twice.
    4. Clear Confirm before tagging documents in Screen 3 of 5 and click Next.
    5. 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.
    6. Click Next.
    7. In Screen 5 of 5, select Display PDF documents in the web browser.
    8. 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
    1. Click Edit > Preferences.
    2. Click General in the Categories list.
    3. Clear the Enable Protected Mode at startup check box.
    4. Click OK, and restart the reader.
    5. 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
    1. Click Edit > Preferences.
    2. Click Security (Enhanced) in the Categories list.
    3. Clear the Enable Protected Mode at startup check box in the Sandbox Protection Area. When prompted to confirm your choice, click OK.
    4. Click OK, and restart the reader.
    5. 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 HCL OneTest UI script assure values
    1. Open HCL OneTest UI, and click Window > Preferences.
    2. In the Preferences window, expand Functional Test > Playback, and then click Script Assure.
    3. Click Advanced.
    4. 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
Notes:
  • 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:
    1. Create the following registry key:
      • HKEY_LOCAL_MACHINE\SOFTWARE\HCL Technologies\HCL OneTest UI\Options
    2. Create a new DWORD variable InvocationTimeout.
    3. For documents of 70 pages or more, specify the timeout value of 8*60*1000 milliseconds.
    4. Restart HCL OneTest UI and restart Adobe Reader.
    5. Perform the clicks on the PDF file until this message is generated: "Ignoring the click on PDF document in document mode setting".
    6. Take the data verification point.
  • 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.