Forum Discussion

lsainsbury's avatar
lsainsbury
Contributor
10 years ago

Defining global object path

Hey guys/girls,

 

I'm having a small issue at the moment, the software I'm testing has alot of floating windows I need to access information from, but the index TestComplete uses to find the object is generated randomly so the tests I'm running will fail alot.

 

I'm looking to define global object paths using variables, so when the windows index changes on that test run, I can change the object path at a global level once rather than on a per script basis, and the scripts will then just reference the variable as the object path.

 

Is this possible? If it is, any information about how to go about doing this would be much appreciated! Or if there's better ways to go about dealing with something like this, would be nice to hear about it!

 

Thank you :)

  • You can either store the path in a string variable and then use eval() when you want it to be an object or you can store it as an object.  We use both.

  • You can either store the path in a string variable and then use eval() when you want it to be an object or you can store it as an object.  We use both.

    • lsainsbury's avatar
      lsainsbury
      Contributor

      Hey Marsha,

       

      Thanks alot for the reply! Sorry its taken awhile for me to get back to you, very busy day at work.

       

      The reply helped a lot, I've managed to create a basic framework today for my test suite which makes things a hell of alot easier on me.

       

      Thanks again :)