-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Unable to set response body and apply it to UI, selenium driver #8
Comments
@Jonahss It will be very helpful if you suggest anything and can we print the response body in JSON format? |
I think the body of the response is just a byte array. So if you want to have that as JSON, find a library to convert a byte array to JSON. It sounds like you're getting an error screen because the body you are setting is not valid JSON? I suggest using your browser developer tools to inspect the body of the response you are getting back. Make sure it is valid JSON. sure you can add setHeaders(). I think you can just do that by adding the right annotation to this file: https://github.com/appium/mitmproxy-java/blob/master/src/main/java/io/appium/mitmproxy/InterceptedMessage.java#L37 |
@Jonahss : Thank you for your reply!, yes I converted byte array to JSON and printed, it is the correct JSON. |
So what is the difference between the packets returned by charlesproxy and the packet returned by mitmproxy-java? |
@Jonahss I figured out the issue, Actually I was mocking OPTIONS call instead of GET call. Now its working fine and able to see expected screen on UI. Thank you for your support! |
Great! Glad you were able to figure it out. Debugging this sort of thing is very difficult. I'm not sure about enterprise jenkins, but there should be a way. You might have to create a custom plugin or something. |
Hi, I am using selenium framework for web application, completed mitm setup, able to get calls and trying to edit the response body using setBody() but not getting the correct response message on the web application after changed the body(getting a common issue screen for all error JSON bodies). Able to edit the response code using setStatusCode(). Can anyone please help me to edit the response body so that it should show correct message on the UI, or if can we add setHeaders also to achieve this then how to use setHeaders()
The text was updated successfully, but these errors were encountered: