SPONSORS:






User Tag List

Results 1 to 9 of 9
  1. #1
    Junior Member
    Join Date
    Mar 2001
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Type Casting Of Class Objects

    Hi
    I want to know whether we can type cast object of one class to the other class.
    As while creating a frame file SilkTest is taking a HtmlLink as a HtmlText.
    Now I want to typecast this HtmlText object to HtmlLink . Can I do this?And if yes how should I proceed?

    Thanks,
    Sumitra

    ------------------

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Type Casting Of Class Objects

    Not entirely certain that I understand your question, but if you're wondering about objects that change (that is, they might be an HtmlText object one time and an HtmlLink object another time), you can do the following in your window declarations:

    That is, essentially, typecasting.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  3. #3
    Junior Member
    Join Date
    Sep 2001
    Location
    oakland, ca, usa
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Type Casting Of Class Objects

    what about

    type MyType is HTMLLink, HTMLText

    then any time you use MyType to declare a
    variable you could pass in either HMTLLink
    or HTMLText. Then use TypeOf() to determine
    it's type.

  4. #4
    Senior Member
    Join Date
    Jun 2000
    Location
    Sunyyvale CA USA
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Type Casting Of Class Objects

    U can typecast a known class to another known class. Only class mapping is allowed in Silk that is from Custom to Standard. By the way why u wanna do this.



    ------------------
    Sree
    Sree

  5. #5
    Junior Member
    Join Date
    Sep 2001
    Location
    Mumbai
    Posts
    25
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Type Casting Of Class Objects

    Hi Sree,
    The problem is , the web application which I am testing has a link but in the .inc file SilkTest is considering it as a HtmlText so I could not use the click method of the HtmlLink. And I want to avoid the use of co-ordinates hence I don't want to use the click method of HtmlText. Can you help me in resolving the problem?
    Thanks in advance,
    Sumitra

    ------------------

  6. #6
    Junior Member
    Join Date
    Mar 2001
    Posts
    21
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Type Casting Of Class Objects

    Hi Sree,
    The problem is , the web application which I am testing has a link but in the .inc file SilkTest is considering it as a HtmlText so I could not use the click method of the HtmlLink. And I want to avoid the use of co-ordinates hence I don't want to use the click method of HtmlText. Can you help me in resolving the problem?
    Thanks in advance,
    Sumitra

    ------------------

  7. #7
    Member
    Join Date
    Nov 2000
    Location
    Tampa, FL USA
    Posts
    90
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Type Casting Of Class Objects

    You do not have to typecast in this case.
    I've used the click method without coordinates on HTMLText (as seen by silktest) that was actually an HtmlLink without typecasting & it works fine.
    (V. 5.0.3.2 VO extension)
    i.e:
    MyAppHome.NewOrderTxt.Click ()

    ------------------

  8. #8
    Senior Member
    Join Date
    Jul 1999
    Location
    New York, NY, USA
    Posts
    137
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Type Casting Of Class Objects

    Janek is correct, you can click on any text object. It inherits the click method from ANYWIN class if I remember correctly.

    ------------------


    [This message has been edited by woodman (edited 09-25-2001).]

  9. #9
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Type Casting Of Class Objects

    The only problem is that, by default, clicking on an HtmlText object will click at coordinates 0,0 if you don't pass in the coordinates where to click. That may not work.

    You may have to use GetRect to click on the middle of the object.

    This may help if you don't want to specify the coordinates every time.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:29 PM.

Copyright BetaSoft Inc.