New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help on Hoverfly GUI localhost:8888 #369
Comments
Hey @MohitIndian, Currently the GUI provided with Hoverfly is fairly minimal in functionality. Hoverfly is mainly controlled using the companion application, hoverctl. This application is a command line utility to easily interacting with Hoverfly's Rest API. |
Hi @MohitIndian - the best place to start after reading through the docs is the tutorials section. The reference section contains information on the API, the simulation schema and CLI commands. |
What is the prerequisite to start with Hoverfly ? |
There are no prerequisites as long as you have the correct Hoverfly binary for your platform. |
How can I run curl and export commands in windows e.g. curl http://hoverfly.io --proxy http://proxy-ip:port Thanks in advance :) |
Hi All, Can I expect the reply on the above query ? Thanks |
cURL binaries are available for most platforms, including Windows, from the cURL website. You will need to install cURL on your machine to execute many of the commands in the tutorials.
The tutorials in the documentation are written for Linux/MacOS environments, as the majority of Hoverfly users are currently on Linux/MacOS. I will set aside some time soon to create some tutorials for Windows users. |
Thanks tjcunliffe !! I think cygwin will also help for curl command ? Thanks |
Yes, you can easily get curl through cygwin. |
Is it necessary to have http://time.jsontest.com in the command ? Can we put any other website for the same ? Thanks, |
You don't have to use http://time.jsontest.com - that's just the example we use in the documentation examples. |
Thanks tjcunliffe !! |
I was just implementing this example... Adding templates to a simulation As per documentation, I have executed these commands... hoverctl start Now, when I opened the json file, It looks like this .. { but in the document, it is given that In short, I havn't got the parameter "requestType" in my exported json file. Thanks a lot .... |
The JSON you posted doesn't contain any request response pairs... it looks like you haven't captured anything. It looks like you have just followed the Applying different delays based on URI tutorial before following the Adding templates to a simulation tutorial. I've just checked the steps in the tutorials and after completing them I have a If you follow the "Applying different delays based on URI" tutorial, then run the following commands: hoverctl start
hoverctl mode capture
curl --proxy http://localhost:8500 http://echo.jsontest.com/foo/baz/bar/spam
hoverctl export my_simulation.json
hoverctl stop
cat my_simulation.json you should see responses and requests in the JSON. Each request should have a |
Thanks tjcunliffe for Reply. I will check. |
While implementing Using middleware to simulate network latency from documentation, I have executed the following commands: hoverctl start but while going through this steps, I got an error msg="Hoverfly could not execute this Please find the attached snapshot for the same. |
Hi All, Can I expect the reply on it ? Thanks and Regards, |
This error indicates that Hoverfly cannot execute the binary specified. Please check that you have Python installed - you can do this by running |
It should probably output standard error from the binary as well. |
Thanks a lot tjcunliffe and mogronalol !!! |
Any reply on this ..... Thanks and Regards, |
Hi There, I am having a similar error when attempted the hoverctl middleware --binary python --script middleware.py I checked python is installed with the python -V command. This is the actual command: hoverctl middleware --binary /System/Library/Frameworks/Python.framework/Versions/2.7/bin/python --script middleware.py I am new to Mac, is the problem it is not resolving the relative path of /System/....? Thanks! |
Hey @MohitIndian, That message is just telling you that middleware has been successfully set. The output is just confirming which the middleware it will be executing. |
Hey @jxlampdx, I have tried to reproduce what you have provided and it has worked fine for me. Could you please provide the middleware.py file that you are using? Could you also include the output of |
Hi @benjih, Thank for your reply. I got it working, the problem was the PATH. It's now producing the result in the middleware.py file! Awesome! :) |
Good news, @jxlampdx I'll make a note to check our documentation. If you think it could have been more helpful, do say. |
Hi @benjih & Hoverfly fans, Now that we got the command line middleware synthesis working, we like to be able to invoke this from our android/java and Swift mobile apps. I see that there is Hoverfly Java binding. can you provide a quick sample of what the invocation looks like in the a Java app? Essentially what we like to do is: In the Java app:
Thank in advance! |
Hi @jxlampdx, hoverfly-java lets you capture and simulate API for testing in JAVA. The easiest way to get started is to add the following JUnit rule to your test:
The first run of your test will capture all HTTP requests to external services, and store the simulation.json into test resources folder. The next time you run it will use the recorded simulation. More information can be found in the docs: Supporting middleware in hoverfly-java is still in the pipeline. Feel free to give your comments or suggestions on this issue: SpectoLabs/hoverfly-java#7 |
@jxlampdx I've provided a work-around to your problem, please check out my comment for this issue: SpectoLabs/hoverfly-java#7 |
@tommysitu we will try the workaround and provide feedback. Thanks! |
Hi @benjih and Team, After executing this command, I am getting this in console. And I am getting this in middleware.log file Kindly guide me know what to do next as I am trying to achieve this. Hoverfly is to capture HTTP(S) traffic to create API simulations which can be used in testing. Thanks in advance. |
Hoverfly Team, The issue we are trying to solve is to enable the front end/client team to make progress and simulate new services without having to wait for backend team to make the modification. thoughts? |
I am not entirely sure what you need but supposing your new API is similar to an existing one you could export the simulation and edit that and reimport it. If you are thinking of something more extensive than that take a look at https://github.com/SpectoLabs/swagger-to-hoverfly |
@JohnFDavenport, I thought about modifying an existing simulation. Let me take a look at the swagger-to-hoverfly solution. Thanks John! |
Hoverfly Team, If we like to edit a previously recorded simulation and essential create a new call. Are these the correct steps in doing so?
Thanks! simulation-createBooking4Room.json.zip APC02SVFZ4GTFM:hoverfly_bundle_OSX_amd64 jlam1$ hoverctl middleware --binary python --script middleware-bookRoom.py import sys logging.basicConfig(filename='middleware.log', level=logging.DEBUG) def main():
if name == "main": APC02SVFZ4GTFM:hoverfly_bundle_OSX_amd64 jlam1$ hoverctl import simulation-createBooking4Room.json APC02SVFZ4GTFM:hoverfly_bundle_OSX_amd64 jlam1$ curl -I http://localhost:8500/rooms/a7155e79-842e-11e6-a1a5-000d3a321a2e/booking |
We got pass the 502 error and now getting a "there was an error when Matching". what should the requestType value be? currently it is "recording" and the error is "could not find recorded request, please record it first!" We couldn't record as this is a new service and hoping to accomplish the call with just a modified simulation file. Is this doable with hoverfly? |
Hey @jxlampdx, Creating simulations that mock services yet to be created is definitely a use case we see Hoverfly supporting. Having a look at your problem, I can see that your simulation is for a POST request with a JSON body attached. The matching problem you are seeing is because the curl request you are sending is a GET request without a body.
You also mentioned the requestType. It is possible to define looser matching by setting the requestType to I have attached a modified version of your simulation, with the request being transformed into a loosely matching template. The reason for doing this was that your request recording had headers attached to it, meaning I would have had to configure my curl program to send the right headers (I'm using a slightly different version of curl so the request would never have matched as a |
@benjih Thanks! will give that a try. I also like the ability to wildcard match with the template approach. |
All done then. Closing the issue as there are no further actions. |
A reminder that questions should be posted here: https://groups.google.com/a/specto.io/forum/#!forum/hoverfly |
Please help me what to do next. As I am beginner to this topic.
I just logged in the GUI. But not getting any tab to explore more on it.
Thanks in advance !!!
The text was updated successfully, but these errors were encountered: