AnsweredAssumed Answered

Hi, I am new to DEVTEST.  I have developed some Virtual services,  which will validate reuest and give conditional response. Find my queries.

Question asked by ICICI_KV on Sep 4, 2015
Latest reply on Sep 9, 2015 by ICICI_KV

Query 1

My request is

<FLD1>1234567890<FLD1>

If the length of FLD1 is 10 characters, Response should

 

be <Message>Valid Input<Message> else <Message>Invalid Input<Message>

I have rwritten

 

match script as below

if (Request_FLD1.toString().length == 10){

Response_Message = "Valid Input";

}

else

{

Response_Message= "Invalid Input";

}

In both the scenarios I am getting static response (stored at the time of creation of S V using request response pair. )

Is match script is getting executed

 

? Is syntax is correct ?

 

Query 2 : Is Regular expression is used to only to check the pattern of input or Can it be used to get dynamic response?.

If pattern matches, getting mapped response else got meta response.

I tried regular expression on two fields.  My observation is if pattern of both the fields matches, got mapped response else got META response.

 

I used Regular expression as below

 

.

PANNO : [A-Za-z]{5}\d{4}[A-Za-z]{1}

Account No : [0-9]{12}

 

My observation :

Both valid, got mapped response

Both invalid, got META response

One of the fields is invalid, got META response

 

If I want specific response, how do I do?   Do I have to use match script with Regular expression

Expected respone is

if both invalid                                      - <Message>Invalid Account no. and PAN No. <Message>

If Account No. is valid and PAN invalid   - <Message>Invalid PAN No. <Message> 

If Account No. is invalid and PAN is valid - <Message>Invalid Account No.

 

<Message> 

 

Pls guide me.

Outcomes