我有一个测试案例在量角器中加载主页,然后单击一个按钮重定向到另一个页面。在其他页面中,我想获取元素的值。量角器 - 改变页面/视图
describe('todo list', function() {
it('should find the contact phone number from the home page', function() {
browser.get('http://homepage...');
element(by.id('re_direct_to_contact_page')).click();
var number = element(by.id('phonenumber')).getText();
expect(number).toEqual('412-....-...');
});
});
然而尽管它加载页面它不检查的元素值和测试案例失败。
量角器如何加载另一个页面来检查值?
注: - 我做了这个例子,但我的实际测试情况下,我从一个页面发送数据到另一个,所以我不能负载我希望直接页。
编辑:堆栈跟踪
protractor conf.js Using the selenium server at http://localhost:4444/wd/hub [launcher] Running 1 instances of WebDriver
Error: Error while waiting for Protractor to sync with the page: "[ng:test] http://errors.angularjs.or/1.4.0/ng/test "
StackTrace: undefined
1 test, 1 assertion, 1 failure
测试用例现在如何失败?请提供堆栈跟踪。 – alecxe
@alecxe更新了堆栈跟踪。 – BDillan
纠正我,如果我错了,联系页面是一个非角度页面? – alecxe