简体   繁体   中英

Cypress can't detect any elements on a particular site

I've started using Cypress (v10.2.0) as an end to end testing framework and wanted to try out logging onto a banking site and filling the input fields.

However, when my Cypress opens https://www.anytimebanking.ulsterbank.co.uk with either Chrome (v102) or Edge (v102), it can't seem to find any site elements, the playground doesn't work and in addition throws a bunch of extension errors:

在此处输入图像描述

I am not sure why this is happening as all the other sites I've tried work as expected, can find the page body and any other elements and don't throw any console errors.

Any help would be appreciated, cheers!

Spec file is as follows:

describe('Online Banking spec', () => {
  it('opens the site', () => {
    cy.visit('https://www.anytimebanking.ulsterbank.co.uk')
  })
})

Actually your entire app and the modal window is contained inside an iframe whose id="ctl00_secframe". So you need to make use of Iframe in cypress to close the Privacy window as well as to fetch other elements.

You can also refer : https://www.cypress.io/blog/2020/02/12/working-with-iframes-in-cypress/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM