Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

vbscript for case statement that has two conditions in HP QTP

Status
Not open for further replies.

kdjonesmtb2

Technical User
Nov 19, 2012
93
US
Hello

I am trying to get this case statement logic to kick off a QTP reporter scenario

The code is not giving any errors and the values appear to be coming through via my print displays but the reporter statement is not being kicked off

Is there a way to have two attributes used in the Case statement instead of using the if then else logic?

Business scenario:

When the DT_service code is “Medical”
and the cptsearchtext1 is “0762” or “0729”
display the reporter line for a CPT code Authorization failed

VBscript:

Select Case cptsearchtext1
Case 0762, 0729

If DT_servicecode="Medical" then

Reporter.ReportEvent 0, "Compare Business Logic Medical Care - CPT Code", "Passed CPT authorization accepted; Test Case=[" & DT_Test_Case &"]; Health Trio=[" & dt_cptsearchtext1 & "]; QNXT=[" & QNXT_codeid1 & "]; QNXT Description=[ " & QNXT_Description1 & "]" 'This code adds CPT code and CPT description to the Report Event screen



Else

Reporter.ReportEvent 1, "Compare Business Logic Medical Care - CPT Code", "Authorization rejected in Health Trio and incorrect CPT code submission; Test Case=[" & DT_Test_Case &"]; Health Trio =[" & dt_cptsearchtext1 & "]; QNXT=[" & QNXT_codeid1 & "]" 'This code adds CPT code and CPT description to the Report Event screen


End If



End Select
 
I'd try this:
Case "0762", "0729"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hello

If I wanted to add the ability to loop this code through multiple occurrences of the cptsearchtext(1-12) what is the syntax for adding the looping? I do not want to have to repeat this logic for 12 occurrences of the cptsearchtext field

Select Case dt_cptsearchtext1
Case "0762","0729"
If DT_servicecode ="Medical" Then

Reporter.ReportEvent 0, "Compare Medical Code - CPT Code", "Passed CPT Code in Health Trio and QNXT match; Test Case=[" & DT_Test_Case &"]; Health Trio=[" & dt_cptsearchtext1 & "]; QNXT=[" & QNXT_codeid1 & "]; QNXT Description=[ " & QNXT_Description1 & "]" 'This code adds CPT code and CPT description to the Report Event screen

End if


Case ""
If DT_servicecode="Medical" Then
Reporter.ReportEvent 1, "Compare Medical Code - CPT Code", "Failed CPT in Health Trio and QNXT - Codes Required!; Test Case=[" & DT_Test_Case &"]; Health Trio =[" & dt_cptsearchtext1 & "]; QNXT=[" & QNXT_codeid1 & "]" 'This code adds CPT code and CPT description to the Report Event screen
End If





End Select



Print "DT_servicecode"
Print DT_servicecode
Print "dt_cptsearchtext1"
Print cptsearchtext1

Thanks!
 
What are dt_cptsearchtextX ?
Is there 12 QNXT_codeidX and QNXT_DescriptionX too ?
Tip: have a look at the Eval function in VBScript.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hello

The dt_cptsearchtextX is a medical procedure code

The other fields also have 12 occurrences

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top