SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Advanced Member
    Join Date
    May 2005
    Location
    Fremont, CA
    Posts
    832
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Accessing Canvas object

    Hello All!

    I was hoping somebody could help me. I'm trying to get a handle on a System.Windows.Controls.Canvas object. I've read somewhere that I need to add it to MSAA properties, but I cannot get it to work. Object browser is not showing it to me.

    Any suggestions?

    p.s. I'm on TestComplete 8 and testing a WPF .NET 3.5 application.

    Thanks.

    dimaj

  2. #2
    Senior Member
    Join Date
    Aug 2006
    Posts
    1,920
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Accessing Canvas object

    Hi,

    Obtain the object whose canvas you want to get and use its native property which will return it to you. You can do this in the way you'd do inside your application.

    Also, MSAA has nothing to do with this.
    Jared - AQA Support

  3. #3
    Advanced Member
    Join Date
    May 2005
    Location
    Fremont, CA
    Posts
    832
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Accessing Canvas object

    Hello Jared,

    Thanks for the reply. I can access it via the properties of a parent object, but I don't have methods like click.

    How can I do that?

    Thanks again.

    dimaj

  4. #4
    Senior Member
    Join Date
    Aug 2006
    Posts
    1,920
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Accessing Canvas object

    Hi,

    If you need to click the Canvas object, you can perform a click on the object to which it belongs. There should be properties which will give you the Canvas bounds - you can get its coordinates via these properties. After that, you'll just need to click the parent object in these coordinates.

    Another option is to use a native method of Canvas to emulate a click (for example, performClick). Look at its methods in the Object Browser.
    Jared - AQA Support

  5. #5
    Advanced Member
    Join Date
    May 2005
    Location
    Fremont, CA
    Posts
    832
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Accessing Canvas object

    Hi Jared,

    Sorry for disappearing for a while...

    I cannot find any properties that relate to canvas' borders or performClick method.

    the control that I'm working with looks like a plot (in excel), where you have your X and Y Axis and a canvas for the dots. So, I'm able to get to the main control (the plot) and to the Canvas via properties. Unfortunately, TestComplete doesn't see Canvas as a UIElement and therefore all user-interaction related functions are not available.

    Thanks again.

    dimaj

  6. #6
    Advanced Member
    Join Date
    May 2005
    Location
    Fremont, CA
    Posts
    832
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Accessing Canvas object

    OK, a little update...

    I've solved this issue, but I don't really like the approach. Here's what I did:

    <font class="small">Code:</font><hr /><pre>
    var plot = Sys.Process("MyApp").Full.Path.To.Plot.Control;
    var systemPoint = Sys.Process("MyApp").AppDomain("MyApp.exe").dotNET .System_Windows.Point.zctor(0, 0);
    var screenPoint = plot.CanvasObject.PointToScreen(systemPoint);
    var canvasOrigin = plot.ScreenToWindow(screenPoint.X, screenPoint.Y);
    </pre><hr />

    Any suggestions?

    dimaj

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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 04:01 AM.

Copyright BetaSoft Inc.