.assert.attributeContains() 建議編輯
檢查元素的指定屬性是否包含預期的值。
用法
範例
this.demoTest = function (browser) {
browser.assert.attributeContains('#someElement', 'href', 'google.com');
};
參數
名稱 | 類型 | 描述 |
---|---|---|
definition |
字串 | 物件 | 用於定位元素的選取器 (CSS/Xpath)。可以是字串或指定 元素屬性的物件。 |
attribute |
字串 | 屬性名稱 |
expected |
字串 | 要檢查的屬性預期包含值。 |
msg 選用 |
字串 | 要在輸出中顯示的可選記錄訊息。如果遺失,預設會顯示一個。 |