How to specify a DataSource Via Linux
I Created a DS in windows and the path (not relative) is to a local file(s) on the same machine.(attachment) We would like to define the path via the command line in linux to the files. The path of the files(s) on the Linux is located here /root/BenchScripts (Not C:....). Do we have to open up the gui on linux to browse to the path? Do not really want to do . thx
Comments
-
Instead of using an OS specific path, you should use a generic path that contains a variable. For example, you could set an environment variable called "BENCH_SCRIPTS" then have your data source reference "${env_var:BENCH_SCRIPTS}/jsondata/LargeJSON". You could set that environment variable from your command line or bash prompt prior to starting SOAtest.
For reference, there are many types types of variables available including these ones, some of which take a parameter after a colon:
${test_suite_loc}
${project_loc:name_of_project}
${workspace_loc}
${env_var:name_of_system_env_var}
${soa_env:name_of_soatest_env_var}0 -
The issue we are having is: we are not able to add anything in the path manually in the file DS path on the gui(${env_var:BENCH_SCRIPTS}/jsondata/LargeJSON)? It would work if we would put the data files in the workspace itself, but not really good thing to do. thx
0 -
The issue we are having is: we are not able to add anything in the path manually in the file DS path on the gui(${env_var:BENCH_SCRIPTS}/jsondata/LargeJSON)?
Oh, I see what you mean. Not sure why that field is locked down. You can do stuff like that is some of the other data source editors that accept a file path, like the Excel and CSV data sources. Perhaps that is something which could be improved later.
It would work if we would put the data files in the workspace itself, but not really good thing to do
Without moving or copying files into the workspace, you can still "import" them. The "import" doesn't involve any moving or copying but is more like a reference, making them visible in the workspace in the without actually putting the files in the workspace directory itself. You can click "File > New > Project..." then uncheck "Use default location" then specify the path to your "BenchScripts" directory. In other words, the project location is disconnected from the workspace location. When the project is "created" this creates a small XML file in your "BenchScripts" directory called ".project". Alternatively, if your "BenchScripts" directory already has a .project file, you would click "File > Import... > Existing Projects into Workspace", select your "BenchScripts" directory and make sure "Copy projects into workspace" is disabled (so the project is simply referenced in place and not copied). For automation, using SOAtest command line, you can build a workspace from scratch by running one or more commands like "soatestcli -data {workspace} -import {project_loc}" to import existing projects (directories containing a .project file) into a workspace directory.
After that, you can click the "Workspace" button in your File Data Source to select your "BenchScripts" project and you will see a path with "project_loc" variable like "${project_loc:BenchScripts}/jsondata/LargeJSON"
0