How to access controls by Name with SilkTest?
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 Cont开发者_开发知识库rols
property, no GetXX
or FindXX
methods.
Our application is written using C# on .NET 3.5, and does make use of third party controls.
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.
精彩评论