Automation on Canvas Grid
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
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
- Go to Tools ->Current Project Properties ->Select Object Mapping- > Expand Java FX controls add your canvas class name and check. Not sure under which item you need to add(someone from Smartbear or your dev can shed some light on this).
- Please refer to the article below which gives info about list of supported JavaFx controls https://support.smartbear.com/testcomplete/docs/general-info/supported-technologies/controls/javafx....
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.
Is there any workaround or mechanism to work with Java Canvas controls using testcomplete
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
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.
TestComplete's documentation mentions only image-based comparisons for canvas objects (for HTML5). And a quick googling returned a set of (useful) articles about canvas. But all these articles outlines that canvas is closed approach that heavily relies on scripting and exposes nothing. (On the contrary to, say, SVG that has a means to access and reuse the data.)
But there is still a chance:) that Helen (@HKosova) will provide some inspiring idea.
/Alex [Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
"TestComplete's documentation mentions only image-based comparisons for canvas objects (for HTML5)."
@AlexKaras .... I would also include OCR, regardless what the documentation says.
For my Delphi canvas objects, they are actually usable (with limitations) using OCR. I do also use a couple of tiny image compares within them, but I get far more useful things done with them using OCR.
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?
SmartBear Documentation Team Lead
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
-- 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
Attched Properties screenshot. Sorry about that
They're both methods screenshots? 😉
(And they don't look promising ..... but we'll wait for the properties one ....)