Am new to Javascript ,node.js and mocha. as i was looking to basic example i encountered an empty function "function()". What's the ppurpose of using empty function.
var assert = require('assert'),
test = require('selenium-webdriver/testing'),
webdriver = require('selenium-webdriver');
test.describe('Google Search', function() {
test.it('should work', function() {
var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
driver.get('http://www.google.com');
var searchBox = driver.findElement(webdriver.By.name('q'));
searchBox.sendKeys('simple programmer');
searchBox.getAttribute('value').then(function(value) {
assert.equal(value, 'simple programmer');
});
driver.quit();
done();
});
});
when i run this sample code i got below error , can u please help me resolving this issue please .
error : Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.
as i see am able to launch browser and open google.com as writted in program but i see fail still
Google Search 1) should work
0 passing (2s) 1 failing
1) Google Search should work: Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test. at null. (C:\Users\kashyap\AppData\Roaming\npm\node_modules\mocha\lib\runnable.js:170:19) at Timer.listOnTimeout (timers.js:110:15)
can you please also suggest me some links to know and try mocha+nodejs with selenium
Aucun commentaire:
Enregistrer un commentaire