Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.
Workspace and project path from script
Comments
-
Hey PBeland!
I did a quick search online and found the following:
http://forums.parasoft.com/discussion/comment/7408#Comment_74081 -
Yeah, I found it too. I'd like to get a path relative to my workspace in case our test structure change. Until then, I can get to there with something like that:
def projectDir = context.getAbsolutePathFile(".\\..\\..\\..\\MyWorkspace"); Application.showMessage("Workspace location is ${projectDir}");
Better than nothing
Thanks
0 -
Hi PBeland,
Here is an example script that utilizes the methods that are mentioned in the link that Omar posted:
from soaptest.api import * from com.parasoft.api import * from java.io import * def main(input, context): f = context.getAbsolutePathFile(".") Application.showMessage(f.getAbsolutePath()) #returns absolute path to project folder s = f.getAbsolutePath() + File.separator + "some.xml" Application.showMessage(s)
These API calls will return the path to the Project folder that contains the extension tool.
0