Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

169
Views
Cypress unable to find form element on webpage

I'm currently trying to do some very basic tests in regards to the input fields at https://whitelabel.sandbox.array.io/signup?platform=v3 but having trouble in Cypress in finding the form elements. The code I have is as follows:

describe('Verify identity data', () => {

  it('Makes an assertion', function () {
    cy.visit('https://whitelabel.sandbox.array.io/signup?platform=v3');
    cy.get('input[name=firstName]');

  });

});

However Cypress is giving me the error:

Timed out retrying after 4000ms: Expected to find element: input[name=firstName], but never found it.

Am I using the incorrect selector here? Any advice would be appreciated!

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

It is because you are using a shadow DOM

to access use .shadow https://docs.cypress.io/api/commands/shadow

describe("Verify identity data", () => {
  it("Makes an assertion", function () {
    cy.visit("https://whitelabel.sandbox.array.io/signup?platform=v3");
    cy.get("array-account-enroll").shadow().find('input[name="firstName"]');
  });
});
about 4 years ago · Santiago Trujillo Report

0

There's a shadow root in the DOM, but it's pretty high up in the DOM and likely to affect a lot of your commands.

Add a config setting to the test or to cypress.confi.js and you won't have to worry about appending every command.

describe("Verify identity data", {includeShadowDom: true}, () => {

  it("Makes an assertion", function () {
    cy.visit("https://whitelabel.sandbox.array.io/signup?platform=v3");

    cy.get('input[name="firstName"]');
    cy.get('input[name="lastName"]');
  });
})
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!