querying Joomla! components from phpstorm does not work - joomla2.5

I'm trying to test some Joomla!'s output from phpstorm by using the inner "test RESTful web services" as known as "Rest client".
Basically the URL I would like to test asks for the component to load and task to perform. The loaded model by the controller reads the body of the POST request for performing some task.
To test it, I set my "Rest client" up: POST option, URL and body content are properly filled and then I run my request. Unfortunately, Joomla! seems not to read my URL parameters and because of this the home page is returned instead of loading the component, view and running the requested task.
Here is a snapshot of my settings:
Has anybody bumped into this issue? Any suggestion?

I did it: I placed a new header item Content-Type to application/x-www-form-urlencoded and it worked smoothly.

Related

Jmeter HttpRequest shows "browser is currently set to block cookies"

I am new to Jmeter. I tried to send an HTTP request but the HTTP response showed "cookie is blocked"
enter image description here
I tried to create the HTTP Cookie Manager and set the cookie policy as Compatibility but doesn't work.
and also tried to set CookieManager.save.cookies=true in JMeter.properties file, but both don't work.
Any suggestions would be appreciated.
If this is a very first request - no cookies are involved, most probably the application you're testing tries to set a cookie via JavaScript and not using Set-Cookie header
As per Apache JMeter project main page:
JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).
So you need to inspect the page, you're opening using browser developer tools and if the cookies are being created/set by JavaScript - you will need to replicate the same logic using JSR223 Test Elements and Groovy language, check out Modifying Cookies in JMeter with Groovy article for more details.

The Request URL is being called twice when using URLRewrite Filter

I am using Tuckey URL Rewrite filter. I have installed it on my Google App Engine (Java). and it is working well besides one annoying thing. Apparently when the request URL is re-written and handled by the controller a new request is being issued with no parameters to the same controller. This happens after the HTTP response has been returned from the first call.
I have copied the basic configuration I read on the site and did not change it much.
What could have gone wrong?
It seems that Tuckey URL Rewrite filter is working properly.
I had an issue with jQuery UI Tabs which issue the request twice.

Cookie Manager of Apache JMeter doesn't add the cookie to POST request

I build up very simple test plan.
Login: POST, a session cookie is returned.
Get the state: GET, a user state is returned.
Create a resource: POST, JSON body is supplied for the resource.
So my 'Test Plan' looks like:
Test Plan
Thread Group
HTTP Request Defaults
HTTP Cookie Manager
Login (HTTP Request Sampler: POST)
Get State (HTTP Request Sampler: GET)
Create Resource (HTTP Request Sampler: POST)
The cookie generated by 'Login' is added to 'Get State' correctly.
But 'Create Resource' has NO cookie. I changed their order but it doesn't help.
I used the default options firstly and changed some options but it also doesn't help.
Is it a bug of JMeter? or just POST http request is not able to have cookie?
Please give me any advice.
[SOLVED]
I noticed that it is related to the path, not the method.
You'd like to look at the domain of the cookie as well as the path.
I mean, the path and the domain of a cookie could be defined in the server side through Set-Cookie header.
Another solution is to set CookieManager.check.cookies=false in jmeter.properties usually sitting besides the jmeter startup script in bin.
JMeter for some reasons thinks that you can't set the path=/something in a cookie if you are on http:/somesite/somethingelse. That is the path has to match the path your currently on.
I've never seen a browser enforce this limitation if it actually exists. I've seen and written several sites that use this technique to set a secure cookie and then forward someone say to /admin.
I wish this option was at least in the GUI so I didn't have to change the properties file. I think BlazeMeter is smart enough to turn off checking where flood.io is not. If it were up to me I'd just remove the code that checks this entirely. Why make the load tester any harder then it needs to be.
I had this turned on in my Spring Boot server which was causing the issue with CookieManager in jMeter:
server.servlet.session.cookie.secure=true
Removing this made the cookies flow ! Of course this is for localhost. For Production you may need this turned on.

How to test #DELETE restful service call from JMeter

I am trying to find how to issue a call to the following restful service from JMeter:
#DELETE
#Path("/user")
void removeUser(String userId);
There are plenty examples on POST, GET, but I cannot find one for delete. Specifically, I cannot find a way to pass a parameter for "userId".
Thanks
You could use #RequestParam or #PathVariable to bind the userId . You don't find many tutorial on Delete since it is not supported in earlier versions of HTML . Read this blog for more info . This is usually achieved through a hidden parameter .
Read this post Are the PUT, DELETE, HEAD, etc methods available in most web browsers? for more info .
Have you tried to record that request using jMeter Proxy?
Simply:
Add > Logic Controller > Recording Controller to your Test Plan
Add > Non-test elements > Http Proxy Server to your WorkBench
As Target controller choose your Recording controller
Set your browser proxy settings to point to your jMeter machine (usually your localhost) on standard port 8080
Click Start button at the bottom of your Http Proxy Server component
Fire that delete request in your browser
Immediately after submitting the request, stop the Http Proxy Server (to avoid recording other junk, usually ajax/refresh requests from other opened tabs)
See what jMeter recorded
Use the recorded sampler(s) to build your real test
Details here.
Aha, OK, than maybe you can link (bypass a web app) jMeter with Spring by using jMeter's jUnit Sampler to fire your jUnit test cases directly.
More here: http://jmeter.apache.org/usermanual/junitsampler_tutorial.pdf
Also, take a look here how a guy tried to write a custom jMeter Sampler that was supposed to mimic Spring's HttpInvoker (HttpInvokerProxyFactoryBean).

How to transfer Raphaeljs variable in a JSP page?

I'm in a position to get a value from JavaScript, which uses Raphaeljs and send it to a Servlet/JSP page for Display & DB related work. Kindly assist me for that.
You are going to have to do AJAX for this one. Be sure to load jQuery so is easy to do it.
Simply collect the var value and send it to the JSP using .get or .post. Then you can add your validation in the JSP for the value sent and do whatever you want with it.
Hope this helps!
Jorge C.
As far as i understand this is not Raphael related.
What you need to make sure is, that you understand the difference between client and server side. Javascript runs client side (given we're not talking about a server side application written with JS/nodejs) in the browser while JSPs are executed on the server
If you collect values via JS and want the server to process it then you you can either send it to the server with an AJAX request (which wont reload the page) or manipulate a form and submit it (which will be a GET or a POST request then and will reload the whole page).
On the server you can accept the values and process them and then render the response.
For Ajax request you could look at jQuery.