KeyofSea123
11 years agoContributor
[Res] Conditional Goto XPath Expression
I have a REST test case that sometimes returns
<m:message>(/var/www/html/websvc/actions/ZZZMF.php) errid (SQCSMF-110)QUOTE NOT SUBMITTED. Quote Header failed trying to populate and create in ZZZMF. Chain Message: (quote_order_hdr_post_ws) parameters:* (XWQC-QH-112) Party Bill_To Site does not exist for p_party_number=3143043 at line:671 in file:/var/www/html/websvc/actions/ZZZMF.php with code:0</m:message>
.
(ZZZ hides the call name.)
The party number would change so I was trying to match
*Party Bill_To Site does not exist*
like this
matches(//m:Quote_Create_Submit_Resp[1]/m:call_status[1]/m:message[1]/text(),'*Party Bill_To Site does not exist*')
.
This fails. So does
matches(//m:Quote_Create_Submit_Resp[1]/m:call_status[1]/m:message[1]/text(),'<m:message>(/var/www/html/websvc/actions/ZZZMF.php) errid (SQCSMF-110)QUOTE NOT SUBMITTED. Quote Header failed trying to populate and create in ZZZMF. Chain Message: (quote_order_hdr_post_ws) parameters:* (XWQC-QH-112) Party Bill_To Site does not exist for p_party_number=3143043 at line:671 in file:/var/www/html/websvc/actions/ZZZMF.php with code:0</m:message>')
even though that is the current result of the REST test step.
I need the Conditional Goto to run the REST test step again when that message is returned. Please help me with the proper XPath Expression.
<m:message>(/var/www/html/websvc/actions/ZZZMF.php) errid (SQCSMF-110)QUOTE NOT SUBMITTED. Quote Header failed trying to populate and create in ZZZMF. Chain Message: (quote_order_hdr_post_ws) parameters:* (XWQC-QH-112) Party Bill_To Site does not exist for p_party_number=3143043 at line:671 in file:/var/www/html/websvc/actions/ZZZMF.php with code:0</m:message>
.
(ZZZ hides the call name.)
The party number would change so I was trying to match
*Party Bill_To Site does not exist*
like this
matches(//m:Quote_Create_Submit_Resp[1]/m:call_status[1]/m:message[1]/text(),'*Party Bill_To Site does not exist*')
.
This fails. So does
matches(//m:Quote_Create_Submit_Resp[1]/m:call_status[1]/m:message[1]/text(),'<m:message>(/var/www/html/websvc/actions/ZZZMF.php) errid (SQCSMF-110)QUOTE NOT SUBMITTED. Quote Header failed trying to populate and create in ZZZMF. Chain Message: (quote_order_hdr_post_ws) parameters:* (XWQC-QH-112) Party Bill_To Site does not exist for p_party_number=3143043 at line:671 in file:/var/www/html/websvc/actions/ZZZMF.php with code:0</m:message>')
even though that is the current result of the REST test step.
I need the Conditional Goto to run the REST test step again when that message is returned. Please help me with the proper XPath Expression.
- This works!!
declare namespace m='${#Project#Namespace}';
contains(//m:Quote_Create_Submit_Resp[1]/m:call_status[1]/m:message[1]/text(),'Party Bill_To Site does not exist')