Selenium - text_to_be_present_in_element 和 text_to_be_present_in_element_value 之间的差异

Selenium - Difference between text_to_be_present_in_element and text_to_be_present_in_element_value

你能说明一下 text_to_be_present_in_elementtext_to_be_present_in_element_value 举个例子,最好在 python 中?

下面的 link 似乎解释了 text_to_be_present_in_element 的工作原理,但我仍然不清楚。

http://www.seleniumframework.com/python-basic/waits-and-synchronization/

text_to_be_present_in_element是文本值,用seleniumelement.text或Javascriptelement.textContentelement.innerTEXT

获取值
<p>this is text</p>

text_to_be_present_in_element_value 是元素的 value 属性,用 selenium element.get_attribute('value') 和 JS element.getAttribute('value')

获取值
<input type="text" value="text value">
<input type="button" value="button text value">