Cypress Screenshot gives error of typeerror cannot read properties of undefined (reading replaceall)

289 views Asked by At

I am using Cypress on Amazon workspace using Windows Server 2019 Datacentre as OS. I am trying to take screenshots of a web page and every time getting a same error on my windows that: Cannot read properties of undefined (reading 'replaceAll') at Object.toPosix (https://www.iciciprulife.com/__cypress/runner/cypress_runner.js:159314:56) and Uncaught TypeError: Cannot read properties of null (reading 'getBoundingClientRect') at getViewPercentage (:8:39)

Although my screenshots are getting saved in the screenshot folder but it fails the script execution after taking screenshot.

enter image description here

enter image description here

enter image description here

Test code to reproduce

describe("example to-do app", () =\> {

    it("Signature Testing", () =\> {
    cy.viewport(1336, 720)

cy.visit("https://www.iciciprulife.com/ulip-plans/unit-linked-insurance-plans/icici-pru-signature-ulip-     calculator.html")
    cy.wait(10000)
    cy.screenshot()
    cy.on("uncaught:exception", (err, runnable) =\> {
    console.log(err)
    return false
    })
    })
    })

Cypress Version 12.8.1

Node version 16.14.0

Operating System Windows Server 2019 datacenter

Desired behavior I just want to save my screenshots normally without getting any errors and the script should execute succcessfullyafter taking and saving the screenshots.

https://github.com/cypress-io/cypress/issues/26142

0

There are 0 answers