HTML5: How to get value from Canvas tag binding data

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
hanguyen2009
Posts: 18
Joined: Wed May 27, 2015 9:43 am

HTML5: How to get value from Canvas tag binding data

Post by hanguyen2009 » Wed Aug 12, 2015 9:14 am

Hi Ranorex,

I am trying validate value in cell of data grid that binding in to Canvas tag, but Ranorex Spy can not detected the cell in data grid in the Canvas tag as Table tag.

I need to know how to best capture this cell item for the repository so that I can verify if fields are populated or not.

Thanks a lot

Infor server:
Ranorex: 5.3.3
IE 11
Window 7
Attachments
CanvasBinding.zip
(1.7 MiB) Downloaded 100 times

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3930
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: HTML5: How to get value from Canvas tag binding data

Post by odklizec » Thu Aug 13, 2015 7:41 am

Hi,

Unfortunately, there seems to be no way to extract the individual cells from HTML5 canvas. I'm not quite sure if it's the Ranorex limitation, but I suspect it's rather the way your elements are drawn on canvas? As I understand it, the HTML5 canvas is just a container for graphics, which is dynamically drawn into it (typically by javascript). So there may be no way at all to extract the individual elements from the HMTL5 canvas. I would suggest to drop an email to [email protected].
Last edited by odklizec on Thu Aug 13, 2015 4:02 pm, edited 1 time in total.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: HTML5: How to get value from Canvas tag binding data

Post by krstcs » Thu Aug 13, 2015 4:00 pm

As Pavel said, the Canvas tag in HTML doesn't have data, it contains an image that is rendered. Ranorex cannot do anything with it except for image validation.
Shortcuts usually aren't...

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: HTML5: How to get value from Canvas tag binding data

Post by Support Team » Fri Aug 14, 2015 8:13 am

Hi hanguyen2009,

They are true, since the data will be rendered, you cannot directly access it.

It may just be possible to somehow access the data by using JavaScript, but this also highly depends on your web page and where the original data is stored.
In general you can execute JavaScript by using the ExecuteScript method of the WebDocument, IFrame or FrameTag element, depending on the structure of your web site.
Besides that, I am afraid there is nothing we can do about it.

Regards,
Markus
.
Image