Skip to content

Error: Syntax error, unrecognized expression when selecting a textarea with " in the placeholder in cy.origin in interactive runner #26967

@gkreitz

Description

@gkreitz

Current behavior

Using cy.get to select a <textarea> where the placeholder (and presumably other attributes) contains the substring &quot; causes the error
(uncaught exception)Error: Syntax error, unrecognized expression: TEXTAREA[placeholder="""].

N.B., This bug only happens when running the test in the interactive test runner (GUI), but not when simply running the test from the command line.

Desired behavior

No response

Test code to reproduce

HTML file served up on 127.0.0.1/test.html (it's enough to have this line be the whole file, or you can put it in a more complex document)

<textarea placeholder='&quot;' ></textarea>

Cypress spec causing the error

describe('Cypress error', () => {
    it.only('test cypress', () => {
        cy.origin('https://127.0.0.1', () => {
            cy.visit('/test.html')
            cy.get('textarea')
        })
    })
})

Cypress Version

12.14.0

Node version

Whatever version comes with https://download.cypress.io/desktop

Operating System

Linux, Ubuntu 22.04.2 LTS

Debug Logs

No response

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    E2EIssue related to end-to-end testingTriagedIssue has been routed to backlog. This is not a commitment to have it prioritized by the team.existing workaroundtopic: cross-origin ⤭Topics related to cross-origin navigation in teststopic: cy.originProblems or enhancements related to cy.origin commandtype: bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions