Forum Discussion

Ashcutus's avatar
Ashcutus
Occasional Contributor
8 years ago

PDFBox setup with TestExecute

Hi guys - new here, so go easy on me!

 

I'm running TestComplete 12 (12.10.602.7 to be exact) and I have some tests where I have to validate content in downloaded PDF's from our site.

 

I have integrated PDFBox into TestComplete successfully and the tests are running happily on my machine.

 

The problem comes when I try to get these tests running on our Jenkins slaves which are using TestExecute to run the tests.

 

In my project properties I have specified where my pdfbox-app jar file is, however I can't seem to see anywhere in TestExecute where I can add this - only have the generic Java Bridge JVM location so of course my tests are failing because on test run I'm referencing something that isn't available on TestExecute.  Loading the project directly doesn't seem to help either as I only have the run option, no additional project properties section where I can specify this (unless I've missed it).

 

I have had a look around the support pages as a lurker, and on google but I can only see the guide to get PDFBox running in TestComplete and nothing to do with TestExecute.

 

Is this possible, or will I have to just continue running these locally (not ideal).

 

Cheers,

Ben

 

 

  • Ashcutus's avatar
    Ashcutus
    8 years ago

    Thanks for the reply Robert.

     

    I have figured out how to get around this, and I changed the path to the pdfbox-app jar file to just rest on the main drive and on each jenkins slave I have the same file in the same location.

     

    This seems to do the trick now, and my tests are now running happily on the jenkins slaves.

     

    Just a recap in case someone comes here from Google...!

     

    1. On each TestExecute box, set the java path in the options within TestExecute (Options > Java Bridge)

    2. Copy the pdfbox-app.jar file into a location on the slave (I put mine simply in C:\pdfbox-app.jar).

    3. In TestComplete I changed the class path to reference the .jar file in it's new location in Tools > Current Project Properties > Java Bridge

    4. Saved and committed the changed project properties so that the slaves will pick up the recent changes.

     

    Cheers,

    Ben

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Project properties are stored in the MDS file of the project.  So, effictively copying the MDS file copies those settings (Tools -> Current Project Properties -> Java Bridge) from one machine to another.  

    TestExecute, however, does not have a way of accessing Project Properties since that is part of editing a project and TestExecute is not an editing tool, simply the engine for running something already developed.  This is why you're not finding the same place.

     

    So, as I understand it, in your project, you've added a Java Class and you have defined a set of Class Paths for where to find that class.  What I think you need to do is make sure that you a) add a class path into your project that mirrors the environment on your TestExecute machine and b) make sure that the class is in that directory on your TestExecute machine.  If you have your project properties configured correctly, it should be a transparent transfer.

    • Ashcutus's avatar
      Ashcutus
      Occasional Contributor

      Thanks for the reply Robert.

       

      I have figured out how to get around this, and I changed the path to the pdfbox-app jar file to just rest on the main drive and on each jenkins slave I have the same file in the same location.

       

      This seems to do the trick now, and my tests are now running happily on the jenkins slaves.

       

      Just a recap in case someone comes here from Google...!

       

      1. On each TestExecute box, set the java path in the options within TestExecute (Options > Java Bridge)

      2. Copy the pdfbox-app.jar file into a location on the slave (I put mine simply in C:\pdfbox-app.jar).

      3. In TestComplete I changed the class path to reference the .jar file in it's new location in Tools > Current Project Properties > Java Bridge

      4. Saved and committed the changed project properties so that the slaves will pick up the recent changes.

       

      Cheers,

      Ben

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Bingo... EXACTLY what I had in mind as the solution.  Good that you found it and it works!