Forum Discussion

MulgraveTester's avatar
MulgraveTester
Frequent Contributor
9 years ago

Splitting a project into two projects then referencing project variables

My single project script executes up to 50 large DDTs sequentially so that the log file can become massive. Since my question here failed to come up with a method of breaking up the log file I am trying to split my project in two with a master project calling the salve project for each DDT. Hopefully I will get a separate log file for each slave project execution.

 

My slave project has many calls to project.variables that have been created in the slave project.

When the master project calls methods in the slave project each call (in the slave script) to a project.variable results in "Object does not support this property or method".

My assumption is that the 'project' being referenced here is the master project, rather than the slave project where the command resides.

 

Other than moving all of my slave project variables to become projectsuite variables how can I make my code execute as before?

 

The following may be easier to understand what I am trying to do:

 

MASTER PROJECT : Unit1

'USEUNIT slaveUnit

sub main

  call slaveRoutine

end sub

 

SLAVE PROJECT : SlaveUnit

sub slaveRoutine

   log.message("Project = " & project.filename)

   project.variable.myvariable = 5 '***

end sub

 

When slaveRoutine is executed directly it logs Project = Slave project and sets the slave project variable myvariable to 5.

When slaveRoutine is called from main it logs Project = Master project and returns "Object doesn't support this property or method".

 

 

  • You cannot call routines across projects like that unless Slave Unit is actually a unit in Master project.

    I think you are on the right track in that you need to split your projects up. But, iirc, since you are using Jenkins to run them, simply run the projects that way rather than having to play with Master/Slave projects.
  • Bobik's avatar
    Bobik
    Frequent Contributor

    As I understand you added SlaveUnit unit into both Master project and SlaveProject. Am I right?  

    In this case when you call slaveRoutine from Master project you just execute this routine from Master project.

    I think there is no way to run one project from another project.  This is job for test management system.

     

     

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    You cannot call routines across projects like that unless Slave Unit is actually a unit in Master project.

    I think you are on the right track in that you need to split your projects up. But, iirc, since you are using Jenkins to run them, simply run the projects that way rather than having to play with Master/Slave projects.