4
這是我的conf文件:超時等待頁面加載
// An example configuration file.
exports.config = {
// The address of a running selenium server.
seleniumAddress: 'http://localhost:4444/wd/hub',
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'phantomjs',
'phantomjs.binary.path': 'C:/Users/MY_USER_NAME/AppData/Roaming/npm/node_modules/phantomjs/phantomjs.exe'
},
// Spec patterns are relative to the current working directly when
// protractor is called.
specs: ['example_spec.js'],
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000
}
};
這是我的example_spec.js文件
describe('angularjs homepage', function() {
it('should greet the named user', function() {
browser.get('http://www.angularjs.org');
element(by.model('yourName')).sendKeys('Julie');
var greeting = element(by.binding('yourName'));
expect(greeting.getText()).toEqual('Hello Julie!');
});
});
當我運行它,我總是得到錯誤:
Error: Timed out waiting for page to load Wait timed out after 10129ms
如果我切換到測試只是鉻它工作正常,但我似乎無法讓phantomjs工作。我有最新版本的phantomjs和量角器,新安裝。
如果它是一個移動應用程序,我該怎麼辦? – Emna