.alerts.getText() 編集を提案
現在表示されているJavaScriptのalert()、confirm()、またはprompt()ダイアログのテキストを取得します。
使い方
.alerts.getText([callback])
例
module.exports = {
'get open alert text': function (browser) {
browser
.alerts.getText(function (result) {
console.log('text on open alert:', result.value);
});
},
'get open alert text with ES6 async/await': async function (browser) {
const alertText = await browser.alerts.getText();
console.log('text on open alert:', alertText);
}
};
パラメータ
名前 | 型 | 説明 |
---|---|---|
callback オプション |
function | 結果の値とともに呼び出されるコールバック関数。 |
戻り値
型 | 説明 |
---|---|
string | 現在表示されているアラートのテキスト。 |