可能重复:
Java:静态类?
可以在java中将类实例化为静态吗?
static class c1(){
}
Run Code Online (Sandbox Code Playgroud)
可以这样做吗?我对这个以及非静态内容的内存映射感到困惑.请帮忙
我是Javascript,node.js和mocha的新手.因为我正在寻找基本的例子,我遇到了一个空函数"function()".什么是使用空函数的用途.
var assert = require('assert'),
var test = require('selenium-webdriver/testing'),
var 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();
});
});
Run Code Online (Sandbox Code Playgroud)
当我运行此示例代码时,我得到以下错误,请你帮我解决这个问题.
错误:错误:超出2000ms的超时.确保在此测试中调用done()回调.
谷歌搜索1)应该工作
0传球(2s)1失败
1)谷歌搜索应该工作:错误:超过2000毫秒的超时.确保在此测试中调用done()回调.在null.(C:\ Users\kashyap\AppData\Roaming \npm \node_modules\mocha\lib\runnable.js:170:19)在Timer.listOnTimeout(timers.js:110:15)
你能不能请一些知道的链接,并尝试使用selenium的mocha + nodejs