Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

176
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda