Skip to content
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

Mock response to web browser #365

Closed
jun1983 opened this issue Sep 5, 2017 · 2 comments
Closed

Mock response to web browser #365

jun1983 opened this issue Sep 5, 2017 · 2 comments

Comments

@jun1983
Copy link

jun1983 commented Sep 5, 2017

Hi author, many thanks for providing this amazing tool.

I am testing with selenium webdriver and want to Mock http(s) response to specific requests when submit a form. Is that possible to make Mock Server work as a browser proxy and bypass all irrespective requests to the real destination? In official docs and your previous response to other threads, It only talks about how to do so on a MAC OS. I need to run tests locally on windows laptop and also run it on CI with linux build agents.

Appreciate If you can provide some code examples.

@jamesdbloom
Copy link
Collaborator

Yes it is absolutely possible to do this.

I would suggest you use desired capabilities in selenium to configure a proxy for the browser, see:

This will ensure all calls from the browser go via the proxy. The MockServer can then be used to proxy all the calls by using forward actions, see:

The links above should provide you with the code examples and details you need. I am going to close this ticket.

@Galileo1
Copy link

Galileo1 commented Nov 4, 2018

@jun1983 I am trying something similar that you mentioned in this issue. Could you please care to share your learning or solution for this problem. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants