Difference between webdriver.get() and webdriver.navigate()

前端 未结 14 1499
悲哀的现实
悲哀的现实 2020-11-28 04:27

What is the difference between get() and navigate() methods? Does any of this or maybe another method waits for page content to load? What do I rea

14条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-11-28 04:53

    Not sure it applies here also but in the case of protractor when using navigate().to(...) the history is being kept but when using get() it is lost.

    One of my test was failing because I was using get() 2 times in a row and then doing a navigate().back(). Because the history was lost, when going back it went to the about page and an error was thrown:

    Error: Error while waiting for Protractor to sync with the page: {}
    

提交回复
热议问题