Retrieving JS element properties from an object

Our web application uses highcharts for drawing graphs, and has the same draw objects regardless of if a graph actually returns data or not. Per talking with the development team the console method they are using to determine if data is returned is

"$("#div_id_goes_here").highcharts().series[0].data.length"

and if > 0 then data was actually returned :slight_smile:

Is there a way to retrieve that property from within a Katalon TestObject item, or will I need to make a JS call to grab this property from the respective element?

I’m also finding that there are instances where running that code against an object is sometimes giving a console error, but that’s another story…

You want to retrieve information out of Scalable Vector Graphics instance embeded in a HTML DOM.

No. Test Object works only on HTML DOM. Test Obeject can not work with SVG at all.

Most probably you need to use

https://docs.katalon.com/docs/author/keywords/keyword-description-in-katalon-studio/web-ui-keywords/webui-execute-javascript

Why not you try it first?

Was mainly wanting to see if there was a way to do it within the object itself. We are definitely familiar with the JS execution method, wanting to learn about objects and their limitations at the same time.

Then you’re already aware of how you can access precise, accurate information about elements in the live/dynamic DOM. None of that information is available in a Test Object, which is, first and foremost, a specification for how to find an element. Worse still, once used, any updates to the same element makes the formerly useful Test Object “stale” and therefore useless.

Advice: if you’re so familiar and comfortable with the JS method, build yourself a set of DOM routines in a lib (for example, dom-access.js), then a set of Groovy interfaces (class + methods) to load and execute the JS DOM methods. This will give you a clean, testable, able-to-be-reasoned about set of routines that catapult you forward and away from Test Object limitations.

Disclosure: my Test Object Repository is empty. :astonished: :sunglasses:

I would say again, Test Objects is not helpful for working on SVG at all.