You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 7, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 7, 2026. It is now read-only.
Unable to reflect response in android app using appium and Java #17
Installed MITM proxy, websocket and other related dependecy as mentioned in appiumPro article
Part of code dealing with proxy is as per below
`
List messages = new ArrayList<>();
// remember to set local OS proxy settings in the Network Preferences
proxy = new MitmproxyJava("C:\\Python311\\Scripts\\mitmdump.exe", (InterceptedMessage m) -> {
if(
m.getRequest().getUrl().toString().toLowerCase().startsWith(apiURL.toLowerCase()) &&
m.getRequest().getMethod().equalsIgnoreCase("post")&&
getJsonObject(new String(m.getRequest().getBody())).hasNonNull("operationName")&&
getJsonObject(new String(m.getRequest().getBody())).get("operationName").asText().equalsIgnoreCase("getPharamcyTATInfo")
)
{
JsonNode responseBodyJson = getJsonObject(new String(m.getResponse().getBody()));
String modifiedResp = updateValuesInJson(responseBodyJson.toString(),
"data.getSkuInfo.tatInfo.tatResponse.inventoryExist",false,
"data.getSkuInfo.tatInfo.tatResponse.items[0].exist",false);
m.getResponse().setBody(modifiedResp.getBytes(StandardCharsets.UTF_8));
m.getResponse().getHeaders().add(new String[]{"My Test Resp Header","Header Value"});
messages.add(m);
}
return m;
});
proxy.start();
login(initializeDriver(testMethod),credentialManager);
`
now I have printed the intercepted message and modified response. but the app is still receiving the unmodified request.
when I do below
`
messages.forEach(
x->{
LOGGER.info("########Request Operation : "+x.toString() +getJsonObject(new String(x.getRequest().getBody())).get("operationName"));
LOGGER.info("########### Response Body :" +new String(x.getResponse().getBody()));
}
);`
i see the proper response (modified one), this response never made it app, it is still showing the normal behaviour.
Activity
ashuaviator1987 commentedon Feb 15, 2023
@jlipps can we do a paid support for this issue