Apache Jmeter Recording Controller Uploading file - java

I'm using Apache Jmeter recording controller utility to access a certain website...when using website normally without jmeter proxy settings and other stuff, website works fine with full functionality....but when using Jmeter proxy settings I'm not able any more to upload to the website and it displays me an error.
any ideas!

If you are testing from behind a firewall/proxy server, you may need to provide JMeter with the firewall/proxy server hostname and port number. To do so, run the jmeter[.bat] file from a command line.
How to run the .bat file and how to change its parameters can be find in given URL:-
http://jmeter.apache.org/usermanual/get-started.html#proxy_server
I am sure that should work.

Related

Eclipse HTTP Listener to run Internal Plugin in Headless Mode

I have an Eclipse plugin that my company uses to analyze some data files. I've been tasked with writing a REST application that will take uploaded data files and use this plugin to generate some output and return it to the client.
Currently, my application listens for incoming requests and launches Eclipse in Headless Mode to startup this plugin (e.g. ./eclipse -application "xyz" ...) .
The trouble is, Eclipse is fairly slow to start and each request received launches a new instance of Eclipse.
Ideally, I want only one instance of Eclipse running all the time and an HTTP listener that can request this plugin to run.
I looked into something like Jetty, but my understanding is that Jetty needs to be embedded in the plugin code to setup a listener. Unfortunately, I don't have access to the plugin's source code.
Is this possible? Which tools would you use?

Why JMeter HTTP Proxy server is not recording my local WebApp

I am working with Jmeter 3.1 version and trying to record my local web page. I use a recording template with the default configuration:
File-->Templates-->Recording-->Create
After this, i changued the browser (iexplore) LAN settings:
Internet options --> Connections --> LAN settings
finally, i started the Test Script Recorder using the default configuration created by the template:
The issue is Jmeter is not recording anything for my
localhost page [HTTP]:
http://localhost:7001/MyPage
recording result:
but it does for my server deployed app [HTTPS]:
https://168.12.4.20/System/MyPage
Recording result:
When I follow the instructions in the official manual, the same thing happens
What am I doing wrong? Any recommendation ?
Thank's in advance!
First of all try disabling automatic proxy configuration
JMeter should not "feel" the difference between local and remote deployments, it captures HTTP Requests which are being made by the web browser through its proxy. If JMeter isn't able to "see" the request it normally indicates one of the following:
The request doesn't go into the proxy
JMeter isn't able to "understand" the request (it is not HTTP/HTTPS protocol, JMeter's certificate is not installed in browser, etc.)
You can try out JMeter Chrome Extension as an alternative way of recording a JMeter script, in this case you won't have to worry about proxies and certificates.
I was not able to make work JMETER with IEXPLORE. I had to use a old version of firefox (for applets support). I installed the 50.1.0 firefox versiĆ³n and works
with the next configuration (using default template for recording):
The problem appeared to be my IEXPLORE browser. Not work even after i install the microsoft loopback adapter. I read that this adapter might be the problem.
My Solution:
Remove current version of firefox (using revo uninstaller). this is because the new version can't allow java plugin (My Webapp uses it).
Install old firefox version with advanced settings (disable auto update)
Create default template for recording and start
Set de above configuration [Working configuration]
Test my WebApp a recording the request
Thanks!

Using EasyPHP Webserver

I'm not sure how one goes about using EasyPHP Webserver. Looking around the internet there doesn't seem to be a lot of materials on the matter. Whenever I try to run a php file from the www folder, a new blank tab appears without output from script code (Simple hello world echo). I'm not sure what the problem could be. My Http server and db server is running.
I'm also not sure if EasyPHP devserver is capable of going online. I'm currently in the middle of building an application that requires information to be sent to the server. My android application has been having trouble connecting to the EasyPHP devserver. Will I have more success with EasyPHP Webserver than I will with Devserver?
If you can make a success request using browser, then I think there will be no problem in Android.
Try to debug your webservice using tools like RestClient or PostManager.
Also, when connecting to webservice from Android application, I suggest using third party library like retrofit2. It's quite simple and we will never bothering with parsing json anymore.
In order to get the devserver running, you simply have to right click on the tray icon and select "Open Dashboard". There you can enable and set up all the services such as modules that you need. Please note that EasyPHP devserver is not designed to be used for a production server!
For performance and security reasons, I do strongly recommend to use Apache or nginx with the current stables of PHP 7.0.x and MySQL. If you need some help with that, feel free to ask me in a comment.
EasyPHP Webserver or Devserver are not a web server. It is a manager that installs Apache, PHP, MySQL, and other utilities, just like WAMP or XAMPP.
Just be sure to start the application that loads the Apache server before doing anything.
about your Android device connecting with the server, I'm not sure how that could be done, I have been more lucky using node, gulp and some scripts to generate a web server that is accessible to my devices in my local network.

Run a file locally in java (reach with 'localhost')

I've been requested at work to run a file (server app) locally (so I will have it in localhost) and then send http get requests as I desire.
(I'm using get requests in the form "wget ..... http://localhost:4567/XXXX"
XXXX contains the name of the item I'm trying to receive.
I'm not familiar with the term 'run a file locally'. Can anyone explain / direct me to a website that explains about it?
Suppose my server file name is 'server'. How do I run the file (locally) in java? (so I'll be able to send HTTP get requests as I've mentioned above)
Are you asking for running html files locally so that they can be accessed through a port? If this is the case you need to have a http server on your desktop/laptop and configure it to enable your html files. If it is complete J2EE/.Net/any other platform applications, we need to install appropriate web/application server and run the same.
You have to create webservices and define its path. Suppose if you create a method give it a #Path('someName'). Define what it should consume and what it should produce using #Consumes(MEDIA_TYPE.xxx) #Produces(MEDIA_TYPE.xxx). The whole project will have a base path like restApi. Run it using apache tomcat i desired port. Access the rest api with the url http://localhost:8080/restApi/someName. Refer java webservices for more details. Its very simple. Starting configuration may take some time. So start with a maven artifact for java webservises to have a head start.
If you only want to send some GET requests to check the responses I would use a simple REST client like Postman. Just enter your URL, choose the GET method and send the request.
To run something locally means that the server is installed locally. You would deploy your file/s (.war or .ear in the case of java) to this local server. After that you can access the deployed services via http://localhost:port/...

Test websocket server with junit

Is JUnit able to test a websocket server, or is JUnit unable to complete this task and should another tool then be used to test a websocket server using Java? As of note the websocket server is hosted on a page served by Tomcat 7.0.53.
Your question is confusing. However, perhaps you can look at HTMLUnit which is API that allows you to programmatically access webpages. You can use that with JUnit to test your webpage. You may also want to look at JWebUnit that is based on HTMLUnit. Something else that might be helpful is that you can debug your webapp using Eclipse. You can either run the tomcat server in eclipse or connect to a running server instance (You will need to set some options when starting tomcat if you do not run within Eclipse)
Hope this helps.

Categories

Resources