返回目前頁面的標題。使用 title 協議命令。

用法

                    .getTitle(callback)
                

範例

 this.demoTest = function (browser) {
   browser.getTitle(function(title) {
     this.assert.equal(typeof title, 'string');
     this.assert.equal(title, 'Nightwatch.js');
   });
 };

參數

名稱 類型 描述
callback function

使用結果值呼叫的回呼函式。

返回

類型 描述
string

頁面標題。

另請參閱