Contributions
Re: Test runs successfully with TestComplete but fails when run with TestExecute
Hi All, I was able to find the issue and resolve it ! Posting it anyway incase someone face a similar issue. I was running the script in commandline from the location the TestExecute was installed. Then it was looking for 32bit, though my TestComplete and TestExecute is 64. original path in which I ran the script from: C:\Program Files (x86)\SmartBear\TestExecute 12\Bin> Issue resolved after I ran from x64 C:\Program Files (x86)\SmartBear\TestExecute 12\x64\Bin>1.1KViews2likes0CommentsHow to capture the 'Type' of the message in current row of the Test Item Log
Hi, I have a python script which generate a customised log from the test log. In the script I need to capture the type of of the message in each row in the test log item. I have used the following script for that. I was working fine. However after sometime (maybe because I closed the project and re-opened) the id's used have changed. Appreciate if someone can help me with another method to capture the type of the message. Thank you ! # Obtain the type of the current row & write this to the log file TypeVal = Row.ValueByName["Type"] if (TypeVal == 822415382): Type = "Event" elif (TypeVal == 990187621): Type = "Message" elif (TypeVal == 18446744073223342617): Type = "Checkpoint" elif (TypeVal == 1174736231): Type = "Warning" elif (TypeVal == 923080487): Type = "Error" ExportFile.WriteLine(aqConvert.VarToStr(TypeVal))1.6KViews0likes4CommentsTest runs successfully with TestComplete but fails when run with TestExecute
Hi, I have a python script which reads data from an excel file. Test passes when run through TestComplete, but fails with following error when run through TestExecute. Python runtime error. External table is not in the expected format Error location: I have not done any changes to the excel file and columns are as expected. Appreciate if someone can help me with this. Note: This test was successful earlier with TestExecute too ! I'm onfused as to what has happened. Thank you !Solved1.1KViews0likes1Comment- 1.6KViews0likes0Comments
Capturing the test run date and time of a log item in a script
Hi, I need to create a customised log satisfying our requirements from existing logs. In the summary of the log, I need the following information. 1) Timestamp (Date and Time of the test run) - Pls refer the screenshot 2) Log Item Name 3) Status I was able to get the name and the status, however I don't know how to capture the test run time. I have used the following code, where I get the last log run, and get it's name and status. For now I'm just printing the current time. But instead of current time, what I want is the actual test run time, so that if required, I can refer back to the details test log in the folder where the log is saved. # Getting the log of the last test run LastLog = Project.Logs.LogItem[Count-1] # getting the status of the last log LogStatus = LastLog.Status if (LogStatus == 0): Status = "Passed" elif (LogStatus == 1): Status = "Warning" elif (LogStatus ==2): Status = "Failed" # Writing the Time, Name and Status of the last test run to the exported log file ExportFile.WriteLine(aqConvert.DateTimeToFormatStr(aqDateTime.Now(),"%d/%m/%y %H:%M:%S")) ExportFile.WriteLine("Test Log Name: " +aqConvert.VarToStr(LastLog.Name)) ExportFile.WriteLine("Test Log Status: " +Status) Appreciate if someone can help me with this. Thank you !Solved1.8KViews0likes2CommentsRe: Generating SumoLogic friendly Text log file (or informative XML files)
Thanks everyone. I also managed to capture the type of the message to send to sumologic. Not sure if this is the best way to do it. But works very well for me. Thought of sharing so it might be helpful for someone. # Checks the data type of the log data if LogDataType == ldtTable: # Obtain the total number of rows in the dataset Num = DataSet.RowCount for i in range(0, Num): Row = DataSet.Rows[i] # Obtain the time of the current row & write this to the log file TimeVal = Row.ValueByName["Time"] ExportFile.WriteLine(aqConvert.VarToStr(TimeVal)) # Obtain the type of the current row & write this to the log file TypeVal = Row.ValueByName["Type"] if (TypeVal == 822415382): Type = "Event" elif (TypeVal == 990187621): Type = "Message" elif (TypeVal == 18446744073223342617): Type = "Checkpoint" elif (TypeVal == 1174736231): Type = "Warning" elif (TypeVal == 923080487): Type = "Error" ExportFile.WriteLine(Type) # Obtain the message of the current row & write this to the log file MsgVal = Row.ValueByName["Message"] ExportFile.WriteLine(aqConvert.VarToStr(MsgVal)) -------------------------------------------- So the output looks something like this: 28/08/18 15:29:31 Event The process "firefox" was closed. 28/08/18 15:29:32 Message Mozilla Firefox was launched.2.8KViews1like0CommentsRe: Generating SumoLogic friendly Text log file (or informative XML files)
Hi Alex, Thank you for the link. I was able to generate a customized log by modifying the given sample code. Thanks a lot everyone for their help too. below is a peice of my script which I used to get the timestamp and the log message for each row of the test log. # Checks the data type of the log data if LogDataType == ldtTable: # Obtain the total number of rows in the dataset Num = DataSet.RowCount for i in range(0, Num): Row = DataSet.Rows[i] # Obtai the time of the current row & write this to the log file TimeVal = Row.ValueByName["Time"] ExportFile.WriteLine(aqConvert.VarToStr(TimeVal)) # Obtain the message of the current row & write this to the log file MsgVal = Row.ValueByName["Message"] ExportFile.WriteLine(aqConvert.VarToStr(MsgVal))2.8KViews2likes2Comments