Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Sumit Soman
    @Sumit-Soman

    @chmanie I am struggling to use intercept service 4.1.1
    config looks like
    services: ['intercept', 'selenium-standalone'],
    Post page load i am calling "browser.setupInterceptor();"
    browser.getRequests(); returns empty object

    Am I missing something here.

    Christian Maniewski
    @chmanie
    @Sumit-Soman It seems you have configured it properly as it doesn't throw an error when calling setupInterceptor(). So in this case I'm just assuming that it didn't capture any requests
    Sumit Soman
    @Sumit-Soman
    Thanks for the reply @chmanie
    browser page has lots of network calls made
    do i need to put a pause and wait for the whole page load then call browser.gerRequest()?
    Christian Maniewski
    @chmanie
    Yeah. Try a longer pause.
    Sumit Soman
    @Sumit-Soman
    @chmanie pause didnt help.
    is there a way to capture a network request using the resource name?
    Christian Maniewski
    @chmanie
    No. I don’t know why it’s not capturing your requests, it could be a variety of reasons. What resource are you expecting?
    Sumit Soman
    @Sumit-Soman
    Its a XHR call
    Christian Maniewski
    @chmanie
    Does it happen without user interaction after/when the page is loading?
    Sumit Soman
    @Sumit-Soman
    @chmanie Its is called during page load itself
    Christian Maniewski
    @chmanie
    @Sumit-Soman you will not be able to capture this with this service I’m afraid

    From the readme:

    There's one catch though: you can't intercept HTTP calls that are initiated on page load (like in most SPAs), as it requires some setup work that can only be done after the page is loaded (due to limitations in selenium). That means you can just capture requests that were initiated inside a test.

    Sumit Soman
    @Sumit-Soman
    thanks @chmanie
    any idea how can we achieve this in wdio?
    Christian Maniewski
    @chmanie
    Sorry I don’t think that’s possible. Maybe ask in the webdriver channel
    bmanubolu
    @bmanubolu
    Hello everyone.. i am trying to use intercept service to capture the api call.. but i am facing issue in the first step itself i.e browser.setupInterceptor() method. i have add intercept to services and also i am using "wdio-intercept-service": "^4.1.2", could you please let me know what am I missing here
    3 replies
    Christian Maniewski
    @chmanie
    I don’t see why it wouldn’t be
    bmanubolu
    @bmanubolu
    and one more question is chromedriver service mandatory to use or selenium would suffice?
    Christian Maniewski
    @chmanie
    Anything that works with webdriver.io
    Kirill Eremin
    @StaroKep
    @chmanie hello! Does intercept-service work with the 6'th version of wdio?
    Maybe, do you know, what we can do, to fix that?
    Christian Maniewski
    @chmanie
    @StaroKep yes it does. It seems I just forgot to update that in the read email
    *readme
    Kirill Eremin
    @StaroKep
    I found a strange behavior. When we do browser.url(...) and browser.setupInterceptor(), intercept-service doesn't see "initial" requests. I.e. browser.getRequests() returns empty array.
    But. All other requests (after page loading) it seems fine, and browser.getRequests() returns not empty array.
    With the 5'th version WDIO that problem doesn't exist.
    Do you know, know something about that?
    @chmanie It's hard to describe. Our app makes about 10 initial requests. We get some information from the backend. And these "initial" requests, don't fall into browser.getRequests() array. But, after "full page loading", other requests exist in browser.getRequests() array.
    Christian Maniewski
    @chmanie
    Yeah that’s the major problem of the intercept service. It can only capture subsequent requests reliably. If you could capture some requests before then it was pure luck I’m afraid
    It’s a limitation of selenium, so I don’t think it’s possible to solve on my side
    Kirill Eremin
    @StaroKep
    @chmanie ok, I understand. Thank you, very much.
    Naga Vellanki
    @nvellanki
    @Sumit-Soman How did you resolve this issue? It would be of great help if you can provide some insights.
    @chmanie Did the behavior change related to this requests. Does it pick up all requests?
    Christian Maniewski
    @chmanie
    @nvellanki it does not pick up initial requests made without user interaction. Apart from that it should capture all of them
    What @Sumit-Soman requested is not possible with this library
    kiranmai1202
    @kiranmai1202
    Hi I am new to intercept service, but would like to try to incorporate API testing.
    Any sources will be helpful to start learning and understand it. Thanks!
    Christian Maniewski
    @chmanie

    Hey @kiranmai1202! I’ve created a little example repository to show how to use the intercept service: https://github.com/chmanie/wdio-intercept-example

    Hope it’ll help

    Shiva Prasath Rajendiran.
    @Rajendiransivaprasath
    hi @chmanie , i am using intercept service, i am unable to fetch the Apis of actions under iframe box. is there any way to get those apis using intercept.
    Christian Maniewski
    @chmanie
    Hey @Rajendiransivaprasath, you can actually initialise the service inside an iframe after switching to it via browser.switchToFrame(). See for an example here: https://github.com/chmanie/wdio-intercept-service/blob/master/test/spec/plugin_test.js#L200-L219
    Sivakumar ithanaboina
    @siva1711
    Hello, I am struggling to get the network logs
    const request = browser.getRequests();
    console.log(Browser network logs ${request[0].body});
    output of the above line is undefined. browser.getRequests(), response contains array(2) but response body of each array is empty. Another strange behaviour observed, I could see the response when wdio calling getRequests when trace logging is enabled. but nothing is visible when silent log is enabled. Am I missing any setup here?
    Sugabeca
    @Sugabeca
    Good night all!
    Do you know if this service will help me with extract information from pdf http response?
    Roshan MJ
    @roshanjohn
    Hey @chmanie does the intercept service work with webdriverIO v 6.3 and higher? I'm getting an empty object for browser.gerRequest() after a user interaction on the page.
    Matthias
    @b_wiesacher_twitter
    @chmanie @roshanjohn Actually got similar problem with webdriverio v6.10 -> browser.getExpectations(), browser.getRequests() returns nothing (empty arrays), browser.getRequest(0) returns "Error: Could not find request with index 0" even when running the test from the provided github example: https://github.com/chmanie/wdio-intercept-example-ts
    Nick Chursin
    @unickq

    @chmanie @roshanjohn Actually got similar problem with webdriverio v6.10 -> browser.getExpectations(), browser.getRequests() returns nothing (empty arrays), browser.getRequest(0) returns "Error: Could not find request with index 0" even when running the test from the provided github example: https://github.com/chmanie/wdio-intercept-example-ts

    same here. Can't make it work

    dmarimoutou
    @dmarimoutou
    Hi @chmanie,
    I have the same problem with wdio 6.12 and 7.3: browser.getExpectations() and browser.getRequests() return nothing empty arrays.
    Christian Maniewski
    @chmanie
    Huh, I'll look into it
    dmarimoutou
    @dmarimoutou
    Thanks @chmanie :)
    wbigno
    @wbigno
    image.png
    I need to get a request after an action is taken on a page, but after you click the button a new window opens, so I have it set to close that window so the focus is returned back tot he page that made the network call.. but everytime I run it, I get no results.. as if no requests are made, but I can see them if I manually inspect the page.
    any help would be great, as I am kinda stumped to why this code is not working.
    @chmanie if you have any thoughts that would be great, thanks
    Kirstin Walsh
    @pyxis828
    Not sure if this would help anyone - I have been working on upgrading my wdio project from V5 to V7, and in the process upgraded intercept service from v4.1.2 to 4.1.6 and found that in a couple places where I had requests that were previously populated, I was now getting back empty arrays. Rolled back to v4.1.2 and all is well again. Not sure what changed that might have caused the issue. Having too many other problems to fight with this
    erpachecomo
    @erpachecomo
    Hi community! I've been facing an issue, want to check if someone here can help me. I found some requests are not being retrieved by browser.getRequests() method, if I do manual testing/flow those are being called but as an image instead of XHR. Does anybody knows if it is possible (and how) to intercept these calls? Thanks in advance, I tried to google it but no success, hope I can found help here
    6 replies
    Alex Matunog
    @staizen-alexm
    hi folks, good day! thanks for bringing us this plugin! i've been usign it since wdio4 days. noticed an interesting behavior quite recently
    7 replies
    Kirstin Walsh
    @pyxis828
    I am having an issue where after using the Intercept service, when I try to upload a file, the file upload fails. If I comment out the part where I am suing the Intercept service before the file upload, the file upload works as expected. Is there some way to disable the service once I am done using it so that my file upload will work correctly?