Welcome Everyone Who:

Wants:

· To do right things right first time.

Does not want:

· To do things without value.

Knows that:

· Software Testing never ends, it just stops.

· Software Quality does not happen by accident; it has to be planned.

Believes that:

· There's always one more bug during Software Testing.

· Software Testing is the art of thinking.

Powered By Blogger

Tuesday, August 6, 2013

“Subscript out of range” error message in VBScript

Suddenly one of the existing functions used in QTP for a while started to throw an error: “Subscript out of range”.  error on a line where it was getting assigned an array the results of a Split call “arrLabel = Split(objListLabel.GetROProperty("outertext"), " ")”.

This is a valid statement but it was leaving arrLabel with a null array. The solution I found was to simply repeat the line as seen below. The second time the line is executed arrLabel is populated correctly.

arrLabel = Split(objListLabel.GetROProperty("outertext"), " ")
arrLabel = Split(objListLabel.GetROProperty("outertext"), " ")

If anyone knows the true cause for this error, please share!

No comments:

Post a Comment