webdriverio-community / wdio-intercept-service

🕸 Capture and assert HTTP ajax calls in webdriver.io
MIT License
105 stars 33 forks source link

wdio-intercept-service is not capturing requests invoked in iframe #613

Open rahul-xenon opened 1 year ago

rahul-xenon commented 1 year ago

I have a third party app installed in Microsoft Teams which gets launched in embedded view i.e. in iframe. I am able to capture MS Teams specific requests but unable to capture the traffic initiated via iframe. Is this a known limitation that intercept service doesn't capture iframe traffic..?

rahul-xenon commented 1 year ago

@christian-bromann Can you help here?

tehhowch commented 1 year ago

The iframe has a separate window context; you will need to activate that frame and install the interceptor in it.

rahul-xenon commented 1 year ago

@tehhowch Thanks for replying, I tried switching to frames and then setting up the interceptor via browser.setupInterceptor(); but this didn't work out.

tehhowch commented 1 year ago

@rahul-xenon how exactly does the iframe make requests? If it doesn't use the current value of the window's fetch or XMLHttpRequest, then it isn't going to be using the version that this library has intercepted. This library also does not intercept e.g. websockets or postMessage.

NutriMarc commented 1 year ago

@rahul-xenon how exactly does the iframe make requests? If it doesn't use the current value of the window's fetch or XMLHttpRequest, then it isn't going to be using the version that this library has intercepted. This library also does not intercept e.g. websockets or postMessage.

Any plans to support capturing web sockets in the future? If not, what is the reason?

tehhowch commented 1 year ago

Any plans to support capturing web sockets in the future?

No current plans.

If not, what is the reason?

Time. You are welcome to contribute the functionality and its test cases if you desire to see it in wdio-intercept-service. What free time I have to contribute to this project goes to PR reviews, fixing implementation bugs, and fixing/improving its test suite.