Results 1 to 5 of 5
  1. #1

    How to define normal Class or Structure?

    Using Silk test can we define normal classes and structures. And if yes how to define and use it?
    In God we trust
    The rest we test

  2. #2

    Re: How to define normal Class or Structure?

    What do you mean my normal classes?
    Could you remove the ambiguity in this statement.
    Anyways if you do not consider this class to be abnormal
    winclass myclass
    define your methods or we could call them functions or whatever
    coming to talk about structures well in SilkTest we would use type instead of struct
    struct loginfo
    char[] cLoginId;
    char[] cPassWd;
    would look like this in SilkTest
    type logInfo is record
    STRING sLoginId;
    STRING sPassWd;

    In the script I would use
    logInfo LI;
    I hope this helps you??????
    drive You

  3. #3

    Re: How to define normal Class or Structure?

    Is there any way to create a constructor for a class? I haven't found reference to one anywhere in the help so I'm just making a call to my "constructor" at the beginning of every test script.

  4. #4

    Re: How to define normal Class or Structure?

    I don't think so a inherent constructor concept exists. We can have some make-believe constructors included in a class.
    Reality is NO constructor concept ever existed.
    From my understanding the Silk Scripting language is a derivative of an OOP language minus many features.
    Most of what is required from a testing perspective seems to exist.
    drive You

  5. #5
    Join Date
    Apr 2001
    San Francisco, CA

    Re: How to define normal Class or Structure?

    Here is one of the ways how to simulate constructor:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">[ ] public type MyClass is window

    [ ] // Constructor
    [+] window C_MyTest (STRING sTag, STRING sText)
    [ ]
    [ ] WINDOW wTemp = MyTest (sTag)
    [ ]
    [ ] wTemp.Text = sText
    [ ]
    [ ] return wTemp
    [ ]
    [ ] // Class
    [+] winclass MyTest
    [ ]
    [ ] STRING sText
    [ ]
    [+] property Text
    [-] string Get()
    [ ] return sText
    [-] void Set(string s)
    [ ] sText = s
    [ ]
    [-] hidecalls PrintText ()
    [ ]
    [ ] Print (&quot;This is my TEXT: {this.Text}&quot
    [ ]
    [ ] // Calling
    [+] testcase LetTest () appstate none
    [ ]
    [ ] MyClass foo = C_MyTest (&quot;dummy&quot;, &quot;Hey yo !!&quot
    [ ]
    [ ] foo.PrintText ()
    [ ] </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">I hope that would help!
    Good luck!



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
BetaSoft Inc.
All times are GMT -8. The time now is 05:32 PM.

Copyright BetaSoft Inc.