This description of the CSV Data SetConfig describes that the path to a CSV file used for importing parameters should reside in the bin directory of the JMeter installation, or the path specified should be relative to that bin directory:
Save that file in the bin directory where your JMeter installation lives.
Since the installation path of JMeter is potentially (and in my case actually) different on the various machines involved, this is rather awkward.
What is the preferred way to specify such paths in a way that is independent of the installation directories and the directory the test is stored in?
You can do this:
in your path use __P function
__P(datadir)/file1.csv
When starting JMeter, pass value using -Jdatadir=<your full path to data directory>, see http://jmeter.apache.org/usermanual/get-started.html#override
Turns out that article was wrong. By accident I found out that JMeter seems to consider paths relative to the testscript it has loaded. So no need to put anything in the bin directory of JMeter itself.
Of course if you can't (or don't want) to use relative paths like that either, UBIK LOAD PACKs answer should do the trick.
Related
I have images stored as png files on the local server and only the filename gets saved to the DB. When rendering images to the client I combine the relative path of the image with the filename from the db as pass it in like so:
<img src='../../public/avatar-pictures/3fVZNShyQRAtBbipvzVrDwDD.png'/>
But it doesn't work. As a last attempt of desperation, I even moved the png file itself to the root directory of the client script and it still produced nothing.
what is causing this issue?
By default, node.js and Express do not serve any files. So, you can't give the browser a path to some location on your server's hard drive and expect the web server to send the files. It does not do that (unlike what people familiar with Apache might expect).
You will need a route on your server that points to the public directory. There are several ways to do it, but here's one:
<img src='/public/avatar-pictures/3fVZNShyQRAtBbipvzVrDwDD.png'/>
Then, on your server, you would use the express.static() middleware to create a route that looks for URLs starting with /public and will serve files from the public directory on your hard drive that match the path of the URL:
app.use("/public", express.static("../../public"));
The path you pass to express.static() needs to point to the public directory on your local hard drive. You don't disclose your local file structure so I can't tell you exactly what that should be. The example above will be relative to the current working directory when your program was started. It is perhaps more common to build the path yourself from the module directory. So, if the public directory is two levels above your module directory, you might do this:
app.use("/public", express.static(path.join(__dirname, "../../public")));
And, then it's wired more specifically to be relative to your module's directory and not dependent upon the current working directory which can be changed by code or by how your program is launched.
You can, of course, also use a fully qualified path:
app.use("/public", express.static(path.join("/someVol/users/me/myProject/public")));
Keep in mind that the express.static() middleware opens up the entire directory tree that you point it at for public access so you have to make absolutely sure that only public things are in there. By default, express.static() does not permit .. in the paths so a request can't get out of the directory you specify.
In PhpStorm (as well as other JetBrains IDEs, I'm sure), I'm setting up a File Watcher. In the Watcher Settings section, it asks me to specify the path to the program to be executed.
I want to use the executable file within the node_modules/.bin directory of my project. I don't want it installed globally because I may have other projects that use the same program, but may require a different version.
I could simply specify the absolute path to my project's node_modules/.bin directory, but then if I move the project, the file watcher will break.
In the Arguments and Output paths to refresh fields just below the Program field, it allows you to insert a macro, like $Projectpath$. This is exactly what I need, but it doesn't look like the Program field allows that.
Is there a way to specify a relative path for the Program field?
Here is a screenshot of the File Watcher setup window:
I could simply specify the absolute path to my project's node_modules/.bin directory, but then if I move the project, the file watcher will break.
That's not true -- at very least it does not break anything here -- got 3 projects that use local stuff.
Is there a way to specify a relative path for the Program field?
Sure. Use full path to the program :)
Internally (in config file) it will be stored using $PROJECT_DIR$ (AFAIK) special macro/variable but in actual field (in that dialog window) you will always see full path. Such conversion is done automatically.
You can read a bit more here (in comments): https://youtrack.jetbrains.com/issue/WEB-24376
If you are using the same project on different computers ... where path to the same program will be different but outside of the project (e.g. stored inside user-specific folder and user logins/names are different on such computers) ... you could use Path Variables functionality (Settings/Preferences | Appearance & Behavior | Path Variables) and specify the same variable on all of such computers that would point to correct path on that computer. IDE will automatically use that path variable to store the path.
So .. on one computer MY_TOOL_PATH will be pointing to /Users/Joe/MyTool and on another it could be /Users/Sam/AnotherTool.
I've started using a task runner to export all of my folders into a distribution folder using Gulp. The problem arises when I export images into the distribution folder, the path name is different from the one I'm using in my src file. So, as an example, when I target an image in HTML I type:
/assets/images/example.jpg
However, when the HTML file is distributed, it is supposed to target:
/images/example.jpg
It's still pointing to the assets folder, and creates a dead link. Should I be using a module like gulp-replace to automatically change these path names? Or should I just type in the assumed path name? Or, is there another method that I'm missing?
Sorry if I've phrased this badly, I'm working towards a new developer environment - let me know if I can provide you with any other details.
Should I be using a module like gulp-replace to automatically change
these path names?
Yes, gulp-replace will do the trick.
As an alternative you can place your index.html file into assets folder, so you don't need to change any paths when distributing the project.
currently in my test scripts for automated file upload to browser, the paths are already defined in the value column
command type
target //input[#type='file']
value /Users/.../.../.../filename.extension
in such cases, this script is unable to run on other computers because the path would be different.
my question will be is
is there a way to locate the file in a general folder (for example file is downloaded and in the "download" folder), by using selenium ide can we get the path of the file (/Users/.../downloads/filename.extension)
store the path of the file with its extension into a notepad which i will be using it for multiple test of file uploads later on.
right now if my colleague needs to run the script from his computer, he have to manually change the value to his path.
You could use a suite file that contains a "setup" file to only change the file name in 1 place and the variable is shared across tests in the suite. You could also select an agreed up on place to store the files: c:\test_info\image.jpg.
Or you can make the file available by URL & not local, Unfortunately javascript prevents that for security: How to get the current file path in javascript
Unfortunately I can't think of any other good way unless you all have the same path in a home directory and could do something like ~/test_dir/photo.jpg
I'm having a small drama with the wildcard syntax in my TeamCity artifact configuration. I want to grab every file matching the pattern myproject.*.dll from any folder and place each DLL in the root of the artifacts path.
Here's what I've got at present:
**/obj/Debug/myproject.*.dll => /
This is grabbing all the DLLs but it's putting them inside the same folder structure as the source so rather than ending up with "myproject.web.dll" in the artifacts I get "Web/obj/debug/myproject.web.dll".
What am I missing here?
I'm afraid you cannot do this in an easy way.
You should collect your *.dll locally to a single place, and than use TeamCity's artifacts rule to copy all of them to root directory.
Or, you can enter all paths manually (without ** part)
This is how it works in TC.
I am not sure you can use the artifact root without it copying the structure. The docs specify
If target directory is omitted the
files are published in the root of the
build artifacts.
Can you not just use a designated folder name say dist, would this cause issues? If so what are they!
e.g
**/obj/Debug/myproject.*.dll => dist
Update - found some more info in the docs
The files will be published preserving
the structure of the directories
matched by the wildcard (directories
matched by "static" text will not be
created). That is, TeamCity will
create directories starting from the
first occurrence of the wildcard in
the pattern.
So if you can be more explicit it may lead to a flatter structure.