Defines an IF...THEN...ELSE... conditional statement looking for node(s) on a web page.

The IfXpathExistsThenElse statement is one of the HTML transaction conditional statements. It contains two child steps (Then and Else) which are executed depending on the condition fulfillment:

Then step and child steps are executed when the condition is verified,
Else step and child steps are executed when the condition is not verified.

The condition is the existence in the current web page of nodes matching the XPath defined through the XPath property.
Note: In Convertigo Studio, when an IfXpathExistsThenElse statement is created in a handler, it can be easily replaced by an IfXpathExists, using the right-click menu on the statement and choosing the option Change to > IfXpathExists. The XPath property remains the same and the statements present in the sub-statements are:

• statements present in the Then statement are moved to the IfXpathExists,
• statements present in the Else statement are deleted.

Property Type Category Description
Comment String standard Describes the object comment to include in the documentation report.
This property generally contains an explanation about the object.
Is active boolean standard Defines whether the statement is active.
XPath JS expression standard Defines the XPath expression to test.
This property is a JavaScript expression that is evaluated during the transaction execution as an XPath.
The execution of this XPath on the web page DOM is used as a condition in order to decide whether to execute or not the child statements:

true if one or several nodes are matching the XPath,
false if no node matches.