0

We have an automated test suite, using Borland Silk Test 2008 R2 to carry out regression tests of a new in-house product.

The test script consistently refers to controls by their index:

Form.Control3 ...

We've made a "minor" change to the main form of the application, and now the control that used to have index 3 has index 4.

The easy, but tedious, fix is to edit the scripts to reference Control4 instead of Control3, but this remains pretty brittle.

How do we instead identify the controls by name - so instead of referencing Control3 we specify "the control named ribbon".

(We believe that referencing things by name will be significantly less brittle.)

We've tried the obvious:

Form.ribbon

which doesn't execute at all.

The primitive intellisense in the editor doesn't show much of use - no Controls property, no GetXX or FindXX methods.

Our application is written using C# on .NET 3.5, and does make use of third party controls.

Bevan
  • 43,618
  • 10
  • 81
  • 133

1 Answers1

0

SilkTest usually stores the information to locate the controls in you application in an .inc file. The part

Form.Control3 ...

you mentioned is a reference to the structure in that .inc file. When you application changes, you should be able to adapt your test scripts by simply updating the entry in the .inc file.

tehlexx
  • 2,821
  • 16
  • 29
  • Thanks for the info - I'll pass this onto the guy who's now resonsible for Silk Central and get back to you. – Bevan Nov 09 '10 at 20:32
  • This works, though it turns out to be a bit haphazard - it's not obvious what changes are requires when a test fails. We've effectively stopped using Silk Central because of this. – Bevan Jan 28 '12 at 20:04
  • If you only get "Form" or "Control" as a name this usually means that SilkTest was unable to find a better property to chose as a name. In this case it might help to either change the application to provide better names, or rename the entry manually and change it so something more helpful. – tehlexx Feb 06 '12 at 07:42
  • This highlights one of the problems we found with Silk Test. Our application is built with .NET WinForms: hardly a niche technology. Every window, control, label and panel has a public *Name* property that is both unique and unlikely to change, yet Silk Test ignores those and instead uses the incredibly fragile technique based on the false assumption that child controls are never moved or rearranged within a parent. – Bevan Feb 09 '12 at 04:50
  • @Bevan are you using SilkTest's Classic Agent or the Open Agent? For the CA what you say is correct, but I believe this was addressed for the OA which will prefer the control's name as long as it is unique and uses XPath-based locators to identify controls. This allows you to skip hierarchies, so unless your application changes in a very significant way you should be fine, and otherwise you'll probably have to adapt your tests anyways... – tehlexx Feb 09 '12 at 08:11
  • it was the classic agent, and now we're not using it at all. I'll pass on your comment about the Open Agent, but I suspect that the chances of us resuming use of Silk Test are next to zero. – Bevan Feb 09 '12 at 21:34