I have this code written as a Script Step.
I am extracting the value "BC_PolEffectiveDate" from a web application and comparing it to a value "EffectiveDate" in the database.
I am extracting the value "BC_PolEffectiveDate" from a web application and comparing it to a value "EffectiveDate" in the database.
<
FONT
color=#0000ff
size
=
2
face
=
"courier new"
>
<
P
>If </
FONT
><
FONT
size
=
2
face
=
"courier new"
>Data(</
FONT
><
FONT
color=#800000
size
=
2
face
=
"courier new"
>"EffectiveDate"</
FONT
><
FONT
size
=
2
face
=
"courier new"
>).ToString() = BC_PolEffectiveDate </
FONT
>Then </
P
>
<
P
> <
FONT
size
=
2
face
=
"courier new"
>Log.WriteLine(</
FONT
><
FONT
color=#800000
size
=
2
face
=
"courier new"
>"AQS Policy Effective Date matches
Billing Center Policy Effective Date"</
FONT
>) </
P
>
<
P
> <
FONT
color=#008000
size
=
2
face
=
"courier new"
>Else</
P
>
<
P
> Log.WriteLine("AQS Policy Effective Date does not match Billing Center
Policy Effective Date")</
P
></
FONT
><
FONT
color=#0000ff
size
=
2
face
=
"courier new"
>
<
P
>End If</
P
></
FONT
>
I can see from the log when these two values do not match but when i run the script on a schedule, Test Studio returns just a pass or fail info and the test passes either by going into the IF or ELSE condition. I need to fail the test when the script goes into the ELSE condition. How can i handle that? Is there a custom code that i can use to change the status of the test when i encounter certain conditions?