Forum Discussion
hao_bai
16 years agoOccasional Contributor
@Alexei
Karas [TeamAQA]/David
AQA, thanks for you reply.
Now I'll tell you the whole story in real scenarios of my test project.
1. I have a function in public script file.
=========public ============
Sub RunModel(key1,key2,key3,Object,str)
Call Run3Key(key1,key2,key3)
If Not Object.Exists Then
Runner.Halt("Run " + CStr(str) + " Failed...")
End If
End Sub
=========public end============
2. In scenario A, I need to press key1/2/3 with "F"/"D"/"U", and check the object
"Aliases.Sys.scenarioA.Toolbar" to confirm whether RunModel OK, So I call:
RunModel("F","D","U",Aliases.Sys.scenarioA.Toolbar,"Aliases.Sys.scenarioA.Toolbar")
3. In scenario B/C/D... I also need to process same case, which key and Object changed. But I don't want to write Log.Warning "scenario B/C/D objectB/C/D" in each case, and I also want to accurate track the log which Object cause the case failed.
Now function RunModel(key1,key2,key3,Object,str) can feed my requirements but not easy to use, if I can convert an Object type to a string directly in TC, the str parameter can ignore. I can use RunModel("F","D","U",Aliases.Sys.scenarioA.Toolbar) directly.
Karas [TeamAQA]/David
AQA, thanks for you reply.
Now I'll tell you the whole story in real scenarios of my test project.
1. I have a function in public script file.
=========public ============
Sub RunModel(key1,key2,key3,Object,str)
Call Run3Key(key1,key2,key3)
If Not Object.Exists Then
Runner.Halt("Run " + CStr(str) + " Failed...")
End If
End Sub
=========public end============
2. In scenario A, I need to press key1/2/3 with "F"/"D"/"U", and check the object
"Aliases.Sys.scenarioA.Toolbar" to confirm whether RunModel OK, So I call:
RunModel("F","D","U",Aliases.Sys.scenarioA.Toolbar,"Aliases.Sys.scenarioA.Toolbar")
3. In scenario B/C/D... I also need to process same case, which key and Object changed. But I don't want to write Log.Warning "scenario B/C/D objectB/C/D" in each case, and I also want to accurate track the log which Object cause the case failed.
Now function RunModel(key1,key2,key3,Object,str) can feed my requirements but not easy to use, if I can convert an Object type to a string directly in TC, the str parameter can ignore. I can use RunModel("F","D","U",Aliases.Sys.scenarioA.Toolbar) directly.