Forum Discussion

p_bremm11's avatar
p_bremm11
Contributor
10 years ago

Compare regions using variable?

In my test when I compare a region use the following script (Delphi example):

 

Regions.Danfe_CT_2_4242_Parte1.Check(Aliases.AcroRd32.wndAcrobatSDIWindow.AVSplitterView.AVSplitterView.AVSplitationPageView.AVSplitterView.AVScrolledPageView.AVScrollView.AVPageView, false, false, 0, 0, 'DANFE_CT_48_Parte1_Mask');

 

In the bold words I'd like to substitute a variable, so I will use in a function. Does anyone know how I could do?

 

 
Thank you!!!
  • Hi Patrick,

     

    Here's how you can use the variables in your example:

     

    strRegionName := 'Danfe_CT_2_4242_Parte1';
    strMaskName := 'DANFE_CT_48_Parte1_Mask';

    Regions.Items(strRegionName).Check(Aliases.AcroRd32.wndAcrobatSDIWindow.AVSplitterView.AVSplitterView.AVSplitationPageView.AVSplitterView.AVScrolledPageView.AVScrollView.AVPageView, false, false, 0, 0, strMaskName);
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi Patrick,

     

    Here's how you can use the variables in your example:

     

    strRegionName := 'Danfe_CT_2_4242_Parte1';
    strMaskName := 'DANFE_CT_48_Parte1_Mask';

    Regions.Items(strRegionName).Check(Aliases.AcroRd32.wndAcrobatSDIWindow.AVSplitterView.AVSplitterView.AVSplitationPageView.AVSplitterView.AVScrolledPageView.AVScrollView.AVPageView, false, false, 0, 0, strMaskName);
  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    By the way, I see you are verifying content inside Acrobat Reader. If you need to verify the PDF text and not the visual appearance, there're easier/better  ways to do this. For example, you can read the PDF text programmatically by using the PDFBox library, and then compare it to the expected text.

     

    For other PDF comparison techniques, see this thread: Comparison of two PDF files.