Forum Discussion

mspatel's avatar
mspatel
Contributor
9 years ago

Automation on Canvas Grid

Hi Web Application we are trying to Automate has a grid which as per Spy is Canvas Object. Object Spy can only see the whole Canvas as one object and cant see anything at row level or Cell level. Does anyone give some suggestion how we can do get to cell or Row level . Some Ideas that I already thought about are :

 

1 . Doing Coordinate based scripting . for Example , Call canvas.Click(237, 31) . This is not a option for us because contents of grid going to be dynamic and we have to lookup some text and then select the Cell.

2. Another some what vague options suggested to be is , if Developer Open up some methods for given canvas object and then we access row or columns 

  • sanjay0288's avatar
    sanjay0288
    Frequent Contributor

    Hi,

    Can you try exploring your grid in TC’s Object Browser to identify what properties/methods you can use. To make sure that you see all available properties, switch to the Advanced View mode. Please refer to the "Basic and Advanced View Modes" ( http://smartbear.com/viewarticle/55599/ ) help topic for details.

     

    You can try this

     

    Also can you please provide snapshot of your object spy on the particular control in the advanced view mode and show the list of available properties and methods.

     

     AlexKaras HKosova 

     Is there any workaround or mechanism to work with Java Canvas controls using testcomplete

     

     

     

    • sanjay0288's avatar
      sanjay0288
      Frequent Contributor

      Hi mspatel

         In continuation to my previous reply add your java fx class name under

       

      Tools->CurrentProjectProperties->OpenApplications->JavaFx . Click on Add button and add your canvas class(ex: javafx.scene.canvas.Canvas) .Click on the checkboxes under active column for the canvas class and click on derived classes checkbox. Save the project refresh object browser. Hope this might be of some help.

       

      Refer to the screenshot attached

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        I'm not sure about the JavaFX version, but Canvas objects in Delphi (where I have to work with them) are essentially just an image file. It has no child nodes or objects. All the "controls" (which are just part of the one large image) within it are all virtualized and use a reference file. I can't extract anything much useful from the Canvas itself.

         

        I ended up having to use OCR to do some basic checks against it. But, thankfully, I don't have to interact with it too much.

         

        Maybe it's different for JavaFX ones. But they do still appear to be drawn objects.

         

        The support article for Java FX doesn't mention Canvas as being a class supported by TestComplete, so if it is an image, you may not get much more out of it.

         

        https://support.smartbear.com/testcomplete/docs/general-info/supported-technologies/controls/javafx.html#supported-classes

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi mspatel,

     

    What's your app type - is it a regular web app or JavaFX as others suggested? Is the grid created using a third-party component (if so, which one)? Could you please post an Object Browser screenshot showing the grid object and its properties in the Advanced view?

    • mspatel's avatar
      mspatel
      Contributor

      Hi, 

       

      -- Yes it is Web Application HKosova

      -- I Tried Approach suggested by sanjay0288but didnt make any difference

      -- I have attached Advanced Property View and Advanced Methods View 

       

       

      CORRECTION : 

      Attched Properties screenshot. Sorry about that 

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        They're both methods screenshots? ;)

         

        (And they don't look promising ..... but we'll wait for the properties one ....)