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

163
Views
Website loading with timeout, get() does not get and click() the button

I have to press the button, select different currency and then check 24 hours exchange rates then see if it's positive. I am very new to cypress and trying to learn. I have read the cypress docs, did not manage to find guidance.

This is my code so far.

describe('dropdown select', () => {
    it('open dropdown', () => {
    cy.visit('https://spectrocoin.com/en/bitcoin-price-rates.html')
    cy.get('[class=" css-2b097c-container"]', { timeout: 20000 })
    cy.get('button').contains('USD').click()
    })
})

I added the timeout of 20seconds because it seemed as if the page does not load before finding the element. But it shows a completely different element when highlighted in Cypress environment than Chrome Inspect element environment.

What may be the issue of it not finding the correct button, then selecting, lets say, EUR currency in the dropdown.

Chrome screenshot

Current Status Screenshot

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can do something like this:

describe('dropdown select', () => {
  it('open dropdown', () => {
    cy.visit('https://spectrocoin.com/en/bitcoin-price-rates.html')
    Cypress.on('uncaught:exception', (err, runnable) => {
      return false
    }) //Ignore exceptions
    cy.get('[data-cy=accept-btn]').click()
    cy.get('#currency-select').should('be.visible').click()
  })
})

Instead of the class you can use the id #currency-select selector and this works.

Test Runner Screenshot: test runner execute

To ignore exceptions originating from your webpage you can use this. But your webpage shouldn't throw exceptions in the first place and that your test should be able to catch those in case if it does. So it's not a good practice to use this. Instead let your test fail and ask your developers to look into it and fix it.

Cypress.on('uncaught:exception', (err, runnable) => {
  return false
})
about 4 years ago · Juan Pablo Isaza 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!