I have created a modular structure of the automation. I have individual scripts for different freatures of the application under test. These scripts are located at /Scripts/FeatureScripts folder.
I have some common functions like open the file, read the file. These fucntions are located at /Scripts/CommonFunctions folder.
I am calling the scripts of common fucntions folder in the the feature scripts. When tried to call using “start using”, gives an error.
Could you please how to use scripts located at different locattions??
Are you saying that you have subfolders in the Scripts directory? Or are FeatureScripts and CommonFunctions actually separate suites? If you’re trying to use subfolders in the Scripts directory, that’s not allowed in Eggplant – your scripts won’t show up under the Scripts tab, and Eggplant won’t be able to find or use them.
The Suite is the major organizational structure for Eggplant scripts. If you put the scripts from FeatureScripts into a Suite called FeatureScripts, and you put the CommonFunctions scripts into a Suite called CommonFunctions, then a script in the FeatureScripts Suite can use a script in the CommonFunctions suite like this:
start using "/relative/or/fully qualified/path/to/CommonFunctions.suite/Scripts/MyFunctions.script"
Or you can add CommonFunctions.suite to the Helpers tab of the FeatureScripts and then you can simply say:
start using MyFunctions
Note that “start using” gives your script access to the handlers within a script as though they were part of the calling script. So if MyFunctions contains a function called HappyFunction() and you don’t add MyFunctions with start using, you can access HappyFunction() like this:
If you have added MyFunctions to your script using “start using” then you can make the same call like this:
I hope this helps.