Forum Discussion
mazhar555
14 years agoContributor
Hi Bala,
If you want to export your result to a .txt or .csv file its better to write your own routine, you can export the TestComplete Logs but in most of the cases it does not fulfill our need because as a tester we need Pass or Fail status against each test case.
Well i am not sure how you are managing your test data but i can explain how i am generating test result in a seperate file.
Suppose we have a login test case with the following Data coming from excel sheet
Test Case-ID Login Name Password Expected Result
01 Test1 Test0 Error Message: Incorrect Login information
So now if your system is prompting this error means ur test case is passed if not your test case is failed. Right after pressing the Login Button i am checking the error message and calling the following routine, if error message is there i am passing "Pass", otherwise "Fail".
If ErrorMessage = ExpectedResult Then
LogResultIntoFile "Login",TestCaseID&","&"Passed"
Else
LogResultIntoFile "Login",TestCaseID&","&"Failed"
End If
Function LogResultIntoFile(Module, Result)
CreateFolder "C:\TestResults"
CreateFile "C:\TestResults\"&Module&".csv"
OpenFile "C:\TestResults\"&Module&".csv"
writeNewLine Result
CloseFile
End Function
(it is just an example not a complete solution)
If you want to export your result to a .txt or .csv file its better to write your own routine, you can export the TestComplete Logs but in most of the cases it does not fulfill our need because as a tester we need Pass or Fail status against each test case.
Well i am not sure how you are managing your test data but i can explain how i am generating test result in a seperate file.
Suppose we have a login test case with the following Data coming from excel sheet
Test Case-ID Login Name Password Expected Result
01 Test1 Test0 Error Message: Incorrect Login information
So now if your system is prompting this error means ur test case is passed if not your test case is failed. Right after pressing the Login Button i am checking the error message and calling the following routine, if error message is there i am passing "Pass", otherwise "Fail".
If ErrorMessage = ExpectedResult Then
LogResultIntoFile "Login",TestCaseID&","&"Passed"
Else
LogResultIntoFile "Login",TestCaseID&","&"Failed"
End If
Function LogResultIntoFile(Module, Result)
CreateFolder "C:\TestResults"
CreateFile "C:\TestResults\"&Module&".csv"
OpenFile "C:\TestResults\"&Module&".csv"
writeNewLine Result
CloseFile
End Function
(it is just an example not a complete solution)