1

SilkTest でクラスを作成する方法を教えてください。Open Agent を使用しています。クラスを作成しました:

winclass hello
  void check()
     print("hi")

インクルードファイルに含めましたが、テストスクリプトでオブジェクトを作成するたびに、次のエラーが表示されます

"hello is not a type"

ありがとう

4

1 に答える 1

0

クラスのインスタンスを宣言する必要があります。結果のスクリプトは次のようになります。

[-] winclass hello
    [-] void check()
        [ ] print("Hello world")
[ ] 
[ ] 
[-] window hello helloWindow
    [ ] // this is where you tell silktest how to find helloWindow in your application, for example with an xpath locator
    [ ] 
    [ ] 
[-] testcase foo() appstate none
    [ ] helloWindow.check()

これにより、「Hello World」が出力されます。helloWindow1、helloWindow2 など、さらに多くのインスタンスを作成することもできます。

于 2011-09-13T12:56:28.297 に答える