JMeter replace HTTP method or protocol - replace

I want to replace all/most of HTTP Request's method or protocol
I tried to use Search option in JMeter (also in latest nightly) and I'm finding the http protocol or CONNECT method but when clicking replace none of the occurrences have changed
How can I replace it in JMeter script? only using notepad search&replace?

It’s not possible except in texteditor.
It is partly intentional as search/replace feature in JMeter is built for correlation / variabilization than for pure replacement.
Still if you feel it should be possible, propose a patch after discussion on dev mailing list.

Related

How do i create a google places like API in Nodejs using express

I am trying to create a RESTful service in Node.js using express like the Google places API which should be in the following format.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=%1,%2&radius=%3&name=%4&key=AIzaSyAh4t-qlMYrxnk0XF0Yiu9ZXVFDNfPTCFs
Its very unlike the standard way of passing params to an express app which expects in the following format /google/nearbysearch/place/:location=%1,%2/radius/:radius=%3 and etc..
The challenge here is how to use express and decrypt the response to easily parsing the params to a call. I did extensive research but could not find any links on google or stackOverflow. Thanks for the help.
I hear and have checked out restify (http://mcavage.me/node-restify/) where it allows to pass regex strings to the request url. How do they achieve such in Node.js (solutions without using express will also be helpful).
Thanks
Anurag
You can use Connect.js and Express.js middlware to parse the incoming query string and body conveniently. You can go to the official website http://expressjs.com or look at my examples http://expressjsguide.com and http://webapplog.com.
It's possible to parse without them, but you'll have to write more code (look at the core modules at http://nodejs.org/api).

How can I intercept http requests which an Internet Explorer instance I started performs?

My C++ program launches Internet Explorer (it works with IE6 up to IE10) to display some web page on the Internet; I have no way to modify the web page. The web page references a JavaScript file (using a <script> tag in the HTML markup) - a copy of the swfobject JavaScript library. I'd like the web page to use a custom copy of this file which I provide.
I came up with two possible ways to tackle this
Write a proxy server which Internet Explorer connects to; the proxy fetches the actual data and then rewrites the HTML so that my own copy of swfobject is referenced. This is unfortunately quite a bit of work, and probably won't work with https. I could live without support for https for now.
Implement a asynchronous protocol plugin for Internet Explorer which intercepts all http requests. I know that the JavaScript file is always retrieved using http, so I could intercept accesses to the swfobject JavaScript file and yield my own file instead. Alas, this seems to be impossible as well, a Microsoft support page explains
Internet Explorer ignores naive attempts to overwrite HKEY_CURRENT_ROOT\PROTOCOLS\Http with a value other than the CLSID for
This sounds like hooking 'http' with a custom protocol handler won't work; in any case, this approach would also be problematic in case there is an existing http protocol handler.
Is there a better way to solve this than either of these two?
Depending on the complexity of your requirements, Fiddler may be a useful alternative to a custom proxy since it can automatically rewrite both requests and responses and can be a quick way of scripting what you want.
It also works well with HTTPS, so that part is "free".
Want to have Fiddler automatically rewrite requests and responses, add or remove headers, or flag/ignore sessions based on rules you specify? Check out the FiddlerScript Cookbook
Here is a link to the cookbook
If you need to embed it, it can also be embedded as FiddlerCore.
As #MSalters points out below, the Fiddler's optional SSL interception is something you should consider the trade-offs of before using it. It's documented here and I've written up a short summary of how it works in this answer.
Just shooting down an idea, it's possible to hook the WinSock send() and recv() function in your own process. This is a kind of man in the middle.. This solution has a high complexity drawback tho.
Easy, just translate the URL. Change the swfobject URL to a file:// URL, pointing at your copy.
(You're not actually launching IExplorer.EXE, are you? That's not how you're supposed to open web pages. You either launch a URL with ShellExecute, leaving the browserchoice to the user, or you embed MSHTML, IE's core, in your own app. Internet Explorer isn't part of Windows and may be absent, eg on Windows N.)

Functional testing with Jmeter

I want to check if the value of a cookie change after each reload of a web page.
I've tryied to use beanshell for the purpose but haven't succeed yet. Any example or tutorial ?
It depends on how the cookie is set. If it's a simple Set-Cookie response header then you can verify this using a standard Response Assertion. But if the cookie is normally set or amended using javascript then this code will not be executed by JMeter (it is not a browser) and you would probably do better looking at using a tool more focused on functional testing, like Selenium.
The thing is, JMeter is a tool used to simulate lots of browsers sending requests to a central server to verify that this machine, and it's friends, can support a certain load; it is not really designed to test client side functionality.

Using regEx's to route incoming requests (web server)

I am considering building a web server which routes requests by matching the url to a regex from a list of services that define a regEx property - the first service to match the url handles the request.
I am looking for advice. Has anyone done anything like this? Does using regexs like this sound like a bad idea? If so, what are the possible side effects?
Yes it is a little bad idea. You do not need to reinvent the wheel. For a web server, you will have probably basic requests, /users/all/phones or /items/cool/ascending/top10.. and you will not need advanced regular expressions. Even if you need, a good library Express handles them too. Have a look at ExpressJS Routing, it is already set and probably optimized, so you will not need to hassle with your own routing code.

RESTful Dictionary Service?

this is only loosely programming related.
I wrote myself a shellscript, that extracts all acronyms from a text and writes them to a file. Now I would like to process that file to add the definitions.
My first google hit suggested using curl and the dict:// url scheme. However I am behind a proxy, which does not seem to allow that.
Does any of you know a service that is similar to the dict:// but is provided via HTTP?
Ideally it would be restful since messing around with SOAP seems somewhat bloated for this task.
There are plenty of Dictionary API services listed on http://www.programmableweb.com