admin管理员组文章数量:1336304
I am trying to capture network traffic of iPhone app (using WebdriverIO test framework) using but its not working for me. (there are no logs captured but when tried manually by installing mitmproxy, logs are coming in terminal)
Tried following steps, but no success:-
a) Have installed proxy certificate (generated by http-mitm-proxy) on iphone.
b) Set wifi proxy setting on iphone (server address : macbook ip, port : 8081)
Code:-
import {Proxy} from "http-mitm-proxy";
describe('Calculate perf data', () => {
it('Calculate perf data', async () =>
{
const proxy = new Proxy();
proxy.onError((ctx, err) => {
console.error('Proxy error:', err);
});
proxy.onRequest((ctx, callback) => {
console.log('Proxy request:', ctx.clientToProxyRequest.headers.host, ctx.clientToProxyRequest.url);
ctx.use(Proxy.gunzip);
ctx.onResponseData((ctx, chunk, callback) => {
console.log('Response data:', chunk.toString());
return callback(null, chunk);
});
return callback();
});
proxy.listen({port: 8081}, () => {
console.log('Proxy server is listening on port 8081');
});
console.log('begin listening on 8081')
const email = "///XCUIElementTypeTextField";
const pwd = "//XCUIElementTypeSecureTextField[@name=\"text-input-outlined\"]";
const login = "//XCUIElementTypeButton[@name=\"button\"]";
(await $(email).setValue("[email protected]"));
(await $(pwd).setValue("xyz"));
(await $(login).click());
})
})
本文标签: webdriver ioNot able to capture network traffic on iphone using httpmitmproxyStack Overflow
版权声明:本文标题:webdriver io - Not able to capture network traffic on iphone using http-mitm-proxy - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742405992a2468830.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论