I'm using Cypress to test a website.
When I use xpath inside cy.origin(), It's not working.
it('t1', function() {
cy.origin(('BaseUrl'), () => {
cy.visit('/profile')
cy.xpath("//input[@name='username']").type('user')
cy.xpath("//input[@name='password']").type('pass')
cy.xpath("//button[@type='button']").click()
})
})
Error:
TypeError
cy.xpath is not a function
Note that it works correctly outside cy.origin()
Check to see if non-xpath works.
If not, you've probably not set the
experimentalSessionAndOriginflag correctly.