10-02-2014, 12:25 AM
(This post was last modified: 10-02-2014, 12:52 AM by notknownspammer.)
Hi Everyone,
I need to create a reusable function to update QC step results using QTP.
I am using reporter.ReportEvent then specifying the arguements after each step in QTP script.
After doing this about 7 times I decided that I should create a reusable function to limit the efforts, though a bit concerned because there are so many variables which values differ throughout.
I am having trouble with this code:
The error is:
Type mismatch: 'Reporter.ReportEvent'
Function file: C:\....\....\Desktop\web_methods.qfl
Line (675): "Reporter.ReportEvent vmictypeA, vstepnum, vmessageA".
I am calling this function as:
Please help I am facing a deadline and thank you in advance.
Hi Everyone,
I have resolved the issue.
The error was in the Call to the function specifically the values of the variables vmictypeA and vmictypB.
I realized that the micPass and micFail also have boolean values.
micPass = 0
micFail = 1
Therefore I replaced the micPass and micFail values with 0 and 1.
The script worked like a charm.
Though this approach might be unique, I am curios to what others thought of my approach.
I am ope to any suggestions or advice.
Thank you All and Please use this forum only! For QTP related purposes
I need to create a reusable function to update QC step results using QTP.
I am using reporter.ReportEvent then specifying the arguements after each step in QTP script.
After doing this about 7 times I decided that I should create a reusable function to limit the efforts, though a bit concerned because there are so many variables which values differ throughout.
I am having trouble with this code:
Code:
Public Function fn_StepResult(variable, Vvalue, vmictypeA, vmictypeB, vstepnum, vmessageA, vmessageB)
If variable = Vvalue Then
Reporter.ReportEvent vmictypeA, vstepnum, vmessageA
Else
Reporter.ReportEvent vmictypeB, vstepnum, vmessageB
End If
End Function
The error is:
Type mismatch: 'Reporter.ReportEvent'
Function file: C:\....\....\Desktop\web_methods.qfl
Line (675): "Reporter.ReportEvent vmictypeA, vstepnum, vmessageA".
I am calling this function as:
Code:
Call fn_StepResult(Environment("LVCA"), "3rd Party ID search", "micPass", "micfail", "Step 1", "search preselected / Select 3rd Party ID in search by weblist, and valdiate the list selection is true", "search preselected / Select 3rd Party ID in search by weblist, and valdiate the list selection is true")
Please help I am facing a deadline and thank you in advance.
Hi Everyone,
I have resolved the issue.
The error was in the Call to the function specifically the values of the variables vmictypeA and vmictypB.
I realized that the micPass and micFail also have boolean values.
micPass = 0
micFail = 1
Therefore I replaced the micPass and micFail values with 0 and 1.
The script worked like a charm.
Though this approach might be unique, I am curios to what others thought of my approach.
I am ope to any suggestions or advice.
Thank you All and Please use this forum only! For QTP related purposes