nicktulett
12 years agoContributor
Can't set a breakpoint inside a JScript object with TC 9.3
I've just upgraded from TC 8.7 to 9.3 and I can no longer set breakpoints on functions inside objects.
For instance, I define an object to represent a dialog in the AUT which returns 2 functions to find its window and named fields in the form:
var splitter = node.make({
window: function splitter_window() {
return app.root.SplitterEditor;
},
field: function splitter_field(context, fieldLabel) {
if (!fieldLabel) {
fieldLabel = context;
context = this.window();
} else {
context = this.window()["comp" + context.replace(/ /g, "")];
}
var f = 0, found, limit = context.ChildCount;
fieldLabel = fieldLabel.toLowerCase();
this.window().Refresh();
while ((found = context.Child(f)), f++ < limit) {
Log.Message("~" + found.WndCaption);
if ((found.WndClass === "Static") && (found.WndCaption.toLowerCase() === fieldLabel)) {
while (context.Child(f++).WndClass === "Static");
return context.Child(f - 1);
}
}
return null;
}
}
My problem today is that in 8.7, I can set a breakpoint in one of the internal functions such as splitter_field. In 9.3, I cannot.
I'm hoping that there is a simple solution as it's taken years to come up with this way of writing tests and I don't want to have to go back a decade in the way I write tests.
For instance, I define an object to represent a dialog in the AUT which returns 2 functions to find its window and named fields in the form:
var splitter = node.make({
window: function splitter_window() {
return app.root.SplitterEditor;
},
field: function splitter_field(context, fieldLabel) {
if (!fieldLabel) {
fieldLabel = context;
context = this.window();
} else {
context = this.window()["comp" + context.replace(/ /g, "")];
}
var f = 0, found, limit = context.ChildCount;
fieldLabel = fieldLabel.toLowerCase();
this.window().Refresh();
while ((found = context.Child(f)), f++ < limit) {
Log.Message("~" + found.WndCaption);
if ((found.WndClass === "Static") && (found.WndCaption.toLowerCase() === fieldLabel)) {
while (context.Child(f++).WndClass === "Static");
return context.Child(f - 1);
}
}
return null;
}
}
My problem today is that in 8.7, I can set a breakpoint in one of the internal functions such as splitter_field. In 9.3, I cannot.
I'm hoping that there is a simple solution as it's taken years to come up with this way of writing tests and I don't want to have to go back a decade in the way I write tests.