The dynamic directory/location/path of the suite in my PC

Hi,

I am new to eggPlant and been trying to establish a flexible framework to start work with.

First off, to create the framework, I would like to dynamically get the full path/directory of my current working suite(which is placed in “D:/Automation/New_Scripts/…”).

I tried using the files/folder functions provided by the SenseTalk reference docs but it points of “C:/Users/…/Documents”. I’m not sure why it is pointing to C:/ when my suite is placed in D:/

The reason I need the dynamic path is, I do not wish to hardcode any path/directory in my script as it is not good practice in automation. If I had created 20 scripts and I change my folder path in future, I would have to go back to my 20 scripts and change the hardcoded paths. I creates a lot of re-work which is bad.

Can someone please help me with this?

If you’re only referring to things in the same suite, you shouldn’t need the path at all; eggPlant knows where all the local scripts and images are located. If you’re referring to things in other suites, you can get the path to the current suite with this code:

put suiteInfo().path // the path to the current suite
put the folder of suiteInfo().path // the path to the folder containing the current suite

The reason the code you were using is referencing the C: drive is because the default location of the “Default Suite Directory” is your documents directory. You can change the Default Suite Directory in the eggPlant preferences under the General tab.

1 Like

Thank you Matt :slight_smile:

That did the trick!