browser.setLocation和browser.driver.get有什么区别 [英] What is the difference between browser.setLocation and browser.driver.get
问题描述
我是一个量角器学习者.因此,在测试应用程序时,我正在尝试不同的测试方法.因此,我在每次测试之前使用browser.setLocation
来处理诸如页面在测试运行期间重定向的情况,而不是仅使用browser.driver.get
I'm a protractor learner. So, I'm trying different methods in my tests while I'm testing my application. So, I was using browser.setLocation
Before Each test for cases like page redirected during the test run, instead of just using browser.driver.get
据我了解,我认为使用browser.setLocation
解决了运行测试时遇到的许多随机故障.我不想使用browser.sleep()
.
As I understand I think using of browser.setLocation
resolved lots of random failures I faced while running the test. I didn't want to use a browser.sleep()
.
我阅读了此量角器文档以获得更多说明并没有帮助.
I read this Protractor documentation for more clarification and it doesn't help.
有人可以告诉我这种方法的用法吗?任何信息都将不胜感激.
Can someone tell me the usage of this method. Any kind of information will be appreciated.
先谢谢了. :)
推荐答案
browser.setLocation()
使用 Angular的$ location . browser.driver.get
就像typing in a new URL
进入搜索栏.大多数人使用的browser.get
是browser.driver.get
的包装版本,它等待所有内容同步.
browser.setLocation()
uses Angular's $location. browser.driver.get
is like typing in a new URL
into the search bar. browser.get
, which is what most people use, is a wrapped version of browser.driver.get
which waits for everything to be synced.
这篇关于browser.setLocation和browser.driver.get有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!