Runtime Error Line Number in QTP11(VBScript) - vbscript

Is there any way through which I can get the Current Line in QTP or the Runtime Error Line number? The Error Line Number is displayed on QTP Error Popup, so there must be some way through which we can get the error line number....

The line number information is not accessible, as far as the QTP community knows.

Related

HP UFT (Unified Functional Testing) : Results View : Is there a way to capture the row, line number of the script where it failed?

I usually report the events when it passes or fails like:
Reporter.ReportEvent micPass," Title of the passed Event", " Description of Passed Event"
And
Reporter.ReportEvent micFail," Title of the failed Event", " Description of Failed Event"
Is it a good idea to hard code the line number in the title or description of the event like ?
Reporter.ReportEvent micFail," Test Failed at Line 432 ", " Please check line 432 "
To answer the 2nd part of your question, hard-coding will not be a good idea. If you hard-code the line number and in the future, a few lines get added to the code above that line number, the whole point hard-coding goes in vain as the report will now contain the incorrect-line number(which was hard-coded).
And for the first part, I can understand why you want the line-number to be reported. But I don't think there is any "predefined" way of doing it.
But, you can make your own function to get the line number. Here's an idea that you can implement:
Go to the location where your QTP test is stored. Get the full path of the file script.mts(you can find it inside the Action1 Folder). Also, this path can be constructed dynamically if you have good framework and proper folder structure.
After getting the path, you can open that file(script.mts) as a text stream(using the filesystemobject) in Read only mode.
Now you can traverse through the file line-by-line searching for the text "Reporter.ReportEvent micPass," Title of the passed Event", " Description of Passed Event"". After you have found it, you can easily get the line number and return that from your function to store it in some variable which you can use while reporting.
I have not tried this method myself but would have surely given it a try, If I really needed it.
Hardcoding is not a good idea from an end user perspective. In case it's a regression suite it could be used by a tester who doesn't know how to debug the code or analyze. To get the root cause of the failure through reporting (micPass/micFail) you can further refine your scripts

SSIS: Data conversion failed from a Flat File Source

Good day.
The following are the errors that had occured while processing the flat file:
Error: 0xC02020A1 at Task, File [1]: Data conversion failed. The data conversion for column "Column 0" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.".
Error: 0xC020902A at Task, File [1]: The "output column "Column 0" (14)" failed because truncation occurred, and the truncation row disposition on "output column "Column 0" (14)" specifies failure on truncation. A truncation error occurred on the specified object of the specified component.
Error: 0xC0202092 at Task, File [1]: An error occurred while processing file "filepath" on data row 1.
Error: 0xC0047038 at Task, SSIS.Pipeline: SSIS Error Code DTS_E_PRIMEOUTPUTFAILED. The PrimeOutput method on component "Retrieve Input Batch File" (1) returned error code 0xC0202092. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing. There may be error messages posted before this with more information about the failure.
Source File is a Flat File
Data Type properties for External Column and Output Column is identical:
Data Type: String [DT_STR]
Length is 1143
I've tried to experiment with the values in the properties, but I got no luck. What could be the reason for the error?
In addition, I tried to test 2 files. First file got success result, while the latter did not. Difference between them is, the first one is Dos\Windows, while the other is UNIX. Does it affect the behavior of the flat file?
Thank you so much for your input :)
Go to your flat file connection manager>>> Flat file Source Editor then >>> Click on Error Output >>>> and then to the column in question and select Ignore Failure. This worked for me. (That is if the column size is right)

Unexpected token in Mocha/Chai

This is something I've wondered about for some time now, but only recently am I stuck on this. I am getting this error below when running my test in Mocha:
What does the (14:58) mean? I'm assuming it's the location of the syntax error, but how exactly do I read this in order to locate the error (for future reference)?
Thanks.
It means that node found something it couldn't handle at line 14, column 58 in core.spec.js. Note that the actual error that causes this could be located before this point if your syntax has logical errors.
Example:
if(foo === bar){
console.log('foo equals bar')}
} else { // <-- Unexpected token 'else', but error is on previous line
console.log('nope');
}
would trigger an error on line 3, column 3. But the actual error is the accidental extra ending curly bracket.
(But please, don't post images of code and terminal output. Text will do very well.)

Conditional formatting with repository variable

I am trying to conditionally format a graph with a repository variable. My goal is to end with a number between 1-12 which corresponds to the current month.
When I try,
biServer.variables['CURRENT_MONTH']
I get the following error:
Graphing engine is not responding.
"A fatal error occurred while processing the request. The server responded with: oracle.bi.nanserver.fwk.exception.BISvsException: java.lang.NumberFormatException: For input string: "2014 / 07"."
Trying the following,
RIGHT(biSerber.variables['CURRENT_MONTH'],2)
I get an error:
"A type mismatch occurred while evaluating an expression."
Finally, the follow also errors.
RIGHT('biServer.variables['CURRENT_MONTH']',2)
"The syntax of the expression to be evaluated is invalid."
Anyone have ideas? Thanks.
I ended up with a workaround that is serviceable but not ideal.
I added a new column and created a custom formula where the month number, in this case "7", is compared to the repository value CURRENT_MONTH. If CURRENT_MONTH is greater than 7, then return ".", else return "null". (The period being the least noticeable character I could think of)
From here I added the new column to the graph and set a conditional format on that column where if the value is equal to not null (a period in this instance), apply the desired conditional format.
The following link was most helpful for me.
http://bidirect.blogspot.com/2013/10/conditional-formatting-is-it-possible.html

xCode not showing descriptive error in log console - just hex values

Here is my console of an error occurring in my applications(iOS). i understand what the error is, but i don't know how to get a more descriptive trace of where this is in my code. Before iOS5 and the new xCode, i would be pointed to the line of error in my code. Now most times all i see is a hexadecimal output, and sometimes i get a short descriptive output like shown below.
2011-11-14 09:37:42.868 AppName[916:707] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:]: row (0) beyond bounds (0) for section (0).'
*** First throw call stack:
(0x343288bf 0x345781e5 0x343287b9 0x343287db 0x3779ef1f 0x50cd 0x3428722b 0x4edb 0x4fe9 0x5059 0x3175 0x41f1 0x3770a7ff 0x37708f9d 0x376fb941 0x3776d541 0x2bdf 0x377097eb 0x377033bd 0x376d1921 0x376d13bf 0x376d0d2d 0x30b03df3 0x342fc553 0x342fc4f5 0x342fb343 0x3427e4dd 0x3427e3a5 0x37702457 0x376ff743 0x2987 0x23d0)
terminate called throwing an exception
How can i get a more descriptive log output on errors like this? I would like to be shown/brought to the line of error in my code. Hexadecimal output doesn't help me - or i don't know how to use it to my benefit.
You can print all of your item's attributes.
EDIT:
Error descriptions will be at console, there are no more description to reach.

Resources