Selenium-IDE: How to verify/assert page refresh

后端 未结 4 1871
说谎
说谎 2021-01-15 10:00

I have a link on a page, which refreshes this page when clicked.

How can I verify with Selenium-IDE that the page has really been refreshed/reloaded?

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-15 10:32

    I've solved it by asserting that an element which was originally present on the page, is not present on the page right after refresh, then wait untill the page is fully refreshed, and assert that the element is present again.

    1. refreshAndWait / or clickAndWait on refresh link/button
    2. assertElementNotPresent somePageSpecificElement / check that refresh was really executed
    3. pause 2000ms / wait for refresh to end
    4. assertElementPresent somePageSpecificElement / check that refresh was really executed and same page has been loaded

    UPDATE: Page refresh can also easily be verified if there is some textbox element present. Simply use type command to insert some text into the textbox field, then refresh the page, and the text inside textbox should return to it's original state.

提交回复
热议问题