TestPlan Check
Document

Check

by Group Public on Friday September 18 2009 @ 12:04:29 (1/1 Points)

API ↪Reference ✑ Reply ✓ Stick It ✗ Ditch It ⚐ Tag It

Check verifies that an element with the provided predicate exists in the current response. It can be used in a standalone mode or as part of a condition.

Standalone Syntax

In this form if the element is not found an appropriate error will be generated and the test unit marked as failed.

Check //tag

Also note that you can use other items in the expansion. If you have quotes inside your expression they will be converted to an appropriate form.

set %Name% Big
Check //h1[contains(text(),'%Name%')]

set %Name% Tom's
Check //h1[contains(text(),'%Name%')]

Conditional Syntax

In this form whether the element is present is used as the truth value in a condition. This allows checking for elements without triggering the failure in a script.

if check //img
  Notice there is an image on the page
else
  Notice there is no image on the page
end
© 2008-2010 edA-qa mort-ora-y
Using Persephone and TestPlan
Tag: