cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.02k stars 3.18k forks source link

Problem with finding elements on page by CSS selectors - "there is no tests" #7228

Closed klaudynaz closed 4 years ago

klaudynaz commented 4 years ago

Current behavior:

Hello everyone, I ve got problem with my first scrypt :) I decided to make small scrypt to login in on e-mail. After launch the browser, the page is loading. I am not able to see its preview. And any elements on page (CSS selectors) are not found.

Desired behavior:

The elements should be find by ids

Test code to reproduce

describe('Login',function()
{
    it('Verify logging in', function()

    {
        cy.request("https://profil.wp.pl/login.html?zaloguj=poczta")

        cy.wait(3000)

        cy.get("#login").type("name@name.pl")

        cy.wait(3000)

        cy.get("#password").type("password")

        cy.wait(3000)

        cy.get("#btnSubmit").click()

        cy.wait(3000)

        cy.get(".Button topuser__logout").click()

        cy.wait(3000)
        //.Button topuser__logou

    }
)    }

    )

Versions

MacOs Catalina Chrome 81.0.4044.129

jennifer-shehane commented 4 years ago

You want to use cy.visit() to visit the url, not cy.request().

Please fully read our documentation before getting started. It walks you through a first test in our Getting Started guide.

Issues in our GitHub repo are reserved for potential bugs or feature requests. This issue will be closed since it appears to be neither a bug nor a feature request.

We recommend questions relating to how to use Cypress be asked in our community chat. Also try searching our existing GitHub issues, reading through our documentation, or searching Stack Overflow for relevant answers.