目录
verify系列简介
相关方法
官方API
验证过程
命令详解
verify系列简介
Verify系列是验证,验证目标对象是否一致或不一致。
无论验证结果成功或失败,均继续执行。
相关方法
verify
verify checked
verify editable
verify element present
verify element not present
verify not checked
verify not editable
verify not selected value
verify not text
verify selected label
verify selected value
verify text
verify title
verify value
wait for element edit
官方API
verify
Soft assert that a variable is an expected value. The variable's value will be converted to a string for comparison. The test will continue even if the verify fails.
arguments
-
variable name: The name of a variable without brackets.
-
expected value: The result you expect a variable to contain (e.g., true, false, or some other value).
verify checked
Soft assert that a toggle-button (checkbox/radio) has been checked. The test will continue even if the verify fails.
arguments
- locator: An element locator.
verify editable
Soft assert whether the specified input element is editable (e.g., hasn't been disabled). The test will continue even if the verify fails.
arguments
- locator: An element locator.
verify element present
Soft assert that the specified element is somewhere on the page. The test will continue even if the verify fails.
arguments
- locator: An element locator.
verify element not present
Soft assert that the specified element is not somewhere on the page. The test will continue even if the verify fails.
arguments
- locator: An element locator.
verify not checked
Soft assert that a toggle-button (checkbox/radio) has not been checked. The test will continue even if the verify fails.
arguments
- locator: An element locator.
verify not editable
Soft assert whether the specified input element is not editable (e.g., hasn't been disabled). The test will continue even if the verify fails.
arguments
- locator: An element locator.
verify not selected value
Soft assert that the expected element has not been chosen in a select menu by its option attribute. The test will continue even if the verify fails.
arguments
-
select locator: An element locator identifying a drop-down menu.
-
option: An option locator, typically just an option label (e.g. "John Smith").
verify not text
Soft assert the text of an element is not present. The test will continue even if the verify fails.
arguments
verify selected label
Soft assert the visible text for a selected option in the specified select element. The test will continue even if the verify fails.
arguments
-
select locator: An element locator identifying a drop-down menu.
-
text: An exact string match. Support for pattern matching is in the works. See https://github.com/SeleniumHQ/selenium-ide/issues/141 for details.
verify selected value
Soft assert that the expected element has been chosen in a select menu by its option attribute. The test will continue even if the verify fails.
arguments
-
select locator: An element locator identifying a drop-down menu.
-
option: An option locator, typically just an option label (e.g. "John Smith").
verify text
Soft assert the text of an element is present. The test will continue even if the verify fails.
arguments
verify title
Soft assert the title of the current page contains the provided text. The test will continue even if the verify fails.
arguments
verify value
Soft assert the (whitespace-trimmed) value of an input field (or anything else with a value parameter). For checkbox/radio elements, the value will be "on" or "off" depending on whether the element is checked or not. The test will continue even if the verify fails.
arguments
验证过程
测试页面代码verify.html
selenium 学习之verify系列
selenium test 之 verify系列