https://cypress.io logo
Join Discord
Powered by
# help
  • b

    brash-cpu-33893

    09/26/2022, 5:51 PM
    Hello , Can any one please tel me how to pass xml data as Payload in post request
  • f

    fancy-mechanic-10638

    09/26/2022, 5:52 PM
    You mean other than setting the Content-Type header to
    application/xml
    ?
  • b

    brash-cpu-33893

    09/26/2022, 5:52 PM
    Yeah i have already set headers
  • b

    brash-cpu-33893

    09/26/2022, 5:52 PM
    how to pass Body data in post request
  • f

    fancy-mechanic-10638

    09/26/2022, 5:54 PM
    Is your XML in string format? Seems like you should just be able to pass that.
  • b

    brash-cpu-33893

    09/26/2022, 5:57 PM
    i dont want to pass xml as it is, a few things needs to be pass as a paramters
  • f

    fancy-mechanic-10638

    09/26/2022, 5:57 PM
    You'd have to be more specific as to your need then
  • b

    brash-cpu-33893

    09/26/2022, 5:58 PM
    Yeah Main concern is what is the best way to pass xml body data with some parameters in post request
  • f

    fancy-mechanic-10638

    09/26/2022, 5:59 PM
    Body is either a string or an object. If you mean parameters to the XML itself, you could just replace the string contents. If you mean parameters to the server, then pass an object as the body with the params, and then add an
    xml
    property with the XML value.
  • b

    brash-cpu-33893

    09/26/2022, 6:02 PM
    I did like this.... is there any possibility to keep this xml data some where or I can read it?
    f
    • 2
    • 7
  • b

    brash-cpu-33893

    09/26/2022, 6:55 PM
    @here what would cause the fixture to return a chainable. When I am reading xml file and printing it , the response is something like this $Chainer {specWindow: Window, chainerId: Any one tires please how to read xml file and pass it in API reques t
  • l

    late-planet-4481

    09/26/2022, 6:58 PM
    In my Cypress script I want to run some JavaScript to expand/collapse an open group in the Cypress test runner's log. So I put a
    .then()
    after the command that results in an expandable group, then I run
    document.getElementsByClassName('command-expander-column')[0].click()
    . This works perfectly in the Chrome console, but when the test is running the resulting array is empty. Does anyone understand why it behaves this way?
  • f

    fancy-mechanic-10638

    09/26/2022, 6:59 PM
    Why aren't you doing
    cy.get('.command-expander-column').eq(0).click()
    ?
  • l

    late-planet-4481

    09/26/2022, 7:00 PM
    Because I assume that would target my website, but I want to target the test runner.
  • l

    late-planet-4481

    09/26/2022, 7:12 PM
    I figured it out:
    window.top.document.getElementsByClassName('command-expander-column')[0].click()
  • g

    gentle-byte-6745

    09/26/2022, 8:48 PM
    @here Can I use Cypress for Scala projects?
  • f

    fancy-mechanic-10638

    09/26/2022, 11:43 PM
    Is there a way to ensure that a network call was not made? If I
    cy.intercept
    that code will run if it is called, but I want to ensure it's not called.
  • e

    echoing-book-65002

    09/27/2022, 12:01 AM
    Hi, could some one please help me with the challenge I have in testing a popup overlay dialog box in Cypress test runner? This popup appears upon a button click in a normal browser window, however Cypress test runner is not loading the dialog div class at all into the DOM after the button click and hence is not visible on the Test Runner as well. Please throw some ideas if any one has experiences around this problem already? Thanks much for your time and help.
  • f

    fancy-mechanic-10638

    09/27/2022, 12:11 AM
    @echoing-book-65002 I noticed on my item like that I had to do a
    .click().then(() => ...)
    so that the item actually existed. You could also add a timeout param to the
    cy.get
    call for the dialog.
  • e

    echoing-book-65002

    09/27/2022, 1:30 AM
    hi @fancy-mechanic-10638 . Thanks for your response. I tried that as well but no luck since the element is not loading to the Cypress Test Runner at all and so my below code throwing error at Line 3 - finding '[data-testid=document-dialog] h3'). : (
    Copy code
    cy.get('[data-testid=open-document]', {timeout : 60000}).click().then(($div) => {
            cy.wrap($div)
            .find('[data-testid=document-dialog] h3')
            .should('have.text', 'bankStatement.html')
            cy.on("uncaught:exception", () => {
            return false;
          });
        });
  • e

    echoing-book-65002

    09/27/2022, 1:43 AM
    This dialog is actually being loaded into DOM as a different div element but inside the same HTML body though. That seems to be the challenege here. With this, the above logic of click().then() might not be much helpful I think?
  • f

    fancy-mechanic-10638

    09/27/2022, 4:04 AM
    Ignore your
    $div
    there entirely. Do a
    cy.get
    against the new item that should have appeared.
  • e

    echoing-book-65002

    09/27/2022, 4:43 AM
    No luck with that too @fancy-mechanic-10638. The Cypress Test runner doesn't load the modal div at all in to DOM and hence is not finding it even after I removed the wrap($div). Tried this below code, but not working. > cy.get('[data-testid=open-document]', {timeout : 60000}).click().then(() => { > cy.get('[data-testid=document-dialog] h3', {timeout: 60000}) > .should('have.text', 'bankStatement.html') > cy.on("uncaught:exception", () => { > return false; > }); > });
  • f

    fancy-mechanic-10638

    09/27/2022, 6:32 AM
    Sorry, we've reached the limit of my cypress knowledge there.
  • e

    echoing-book-65002

    09/27/2022, 6:36 AM
    Thanks so much for extending help @fancy-mechanic-10638
  • e

    echoing-book-65002

    09/27/2022, 6:38 AM
    Can I seek any help from others plz @here? I also found that the other modal overlay popups are fine and this perticular one I am struggling with is a fullscreen overlay dialog modal and this modal is not loading into Cypress DOM at all in test runner.
  • v

    victorious-father-41976

    09/27/2022, 9:04 AM
    Can I seek any help from others plz here
  • g

    gentle-accountant-4760

    09/27/2022, 9:27 AM
    Hello people! I wonder what is the best practice to run a test with parameters e.g. if I add npm run cypress --lang gb then it should use the parameter in the tests?
  • b

    brief-kite-35331

    09/27/2022, 9:46 AM
    Hello, I use cypress-mochawesome-reporter, mocha-junit-reporter. When I run my tests I see in the console the message: "Couldn't determine Mocha version". Did anyone have similar issues? I am still on Cypress 9.7.0. I saw on Github this was an issue in very old version of Cypress like version 3
  • b

    brash-cpu-33893

    09/27/2022, 9:53 AM
    Hey Anyone can guide please how to Put variables inside xml file and then set values for variables ...
1...154155156...252Latest