這是此類元素的一個示例
如何99在測驗期間獲得價值?我正在使用劇作家之類的東西,innerText()或者textContent()根本不作業。
await expect(page.locator(element)).toHaveText('99') //OR
await expect(page.locator(element).innerText()).toBe('99')
這些方法應該從類似的元素中獲取值是完全合乎邏輯的。
uj5u.com熱心網友回復:
您必須為此檢查是否存在價值。
await expect(page.locator(element)).toHaveValue('99')
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/493185.html
上一篇:附加到DOM之前的img寬度?
