Ask a Question

Vis.js graph testing using TestComplete

SOLVED
LoneWanderer04
Occasional Contributor

Vis.js graph testing using TestComplete

Hello everybody!

I'm working on a piece of software that has vis.js graphs implemented.   The most I can get from non-calculated fields is the X and Y offset as they are represented in the vis.js graph itself, so -250, -50 with 0,0 being the center of the graph.  Does anybody know any way to get TestComplete to be able to recognize the offsets at the very minimum, or any other more efficient way of testing a graph?  

By default it's clicking at the pixel coordinates I pass into Click or HoverMouse, so -250, -50 is off the graph when I try to FindElement on the graph element, then pass in those coordinates to Click or HoverMouse. The other issue is that I can't use pixel coordinates because we want this to run on multiple computers if possible, so the pixel coordinates would be different on each, causing unexpected actions.

1 ACCEPTED SOLUTION

Accepted Solutions
AlexKaras
Community Hero

Re: Vis.js graph testing using TestComplete

Hi,

 

I took a look at the example provided at https://visjs.org/ (https://visjs.github.io/vis-timeline/examples/graph2d/16_bothAxisTitles.html) and examined example's markup. The sample graph is implemented via <svg> web element which makes me doubting that you will be able to access internals of svg element using standard means of TestComplete (see my reply at https://community.smartbear.com/t5/TestComplete-Functional-Web/Test-a-web-page-with-amCharts-trend-g...)

 

Regards,
  /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.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

5 REPLIES 5
sonya_m
Community Manager

Re: Vis.js graph testing using TestComplete

Thank you for your question!

 

@Wamboo @Reshail @Marsha_R @anupamchampati , can you take a look?🙂


Sonya Mihaljova
Community and Education Specialist

Join Wintertainment 2021 to share your stories, have fun, earn community badges, and more!
AlexKaras
Community Hero

Re: Vis.js graph testing using TestComplete

Hi,

 

I took a look at the example provided at https://visjs.org/ (https://visjs.github.io/vis-timeline/examples/graph2d/16_bothAxisTitles.html) and examined example's markup. The sample graph is implemented via <svg> web element which makes me doubting that you will be able to access internals of svg element using standard means of TestComplete (see my reply at https://community.smartbear.com/t5/TestComplete-Functional-Web/Test-a-web-page-with-amCharts-trend-g...)

 

Regards,
  /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.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

LoneWanderer04
Occasional Contributor

Re: Vis.js graph testing using TestComplete

That's what I had assumed from my investigations as well, I just wanted to make sure I didn't miss anything. I'll dig into methods on my end to see if I can do anything with it. Thank you for the confirmation!

AlexKaras
Community Hero

Re: Vis.js graph testing using TestComplete

BTW, have you seen this help topic: https://support.smartbear.com/testcomplete/docs/app-testing/web/general/html5-support.html#SVG ?
Maybe you will be able to get something useful via native DOM methods as advised?

 

Regards,
  /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.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
LoneWanderer04
Occasional Contributor

Re: Vis.js graph testing using TestComplete

I talked to the dev and they are using the canvas object for vis.js, and I saw your reply to:

https://community.smartbear.com/t5/TestComplete-Functional-Web/How-to-work-with-Canvas-Object/td-p/1...


Unfortunately due to the requirements I have, I don't know if there's much I'll be able to do with TestComplete itself other then recording and replaying or something similar.  since I need to do more then verify the graph, I need to be able to click nodes, drag, etc. the various nodes that are being drawn in order to do other functionality. 

The problem with recording that I encountered already is that if the screen is at all different size then what the test was originally recorded on, the test will fail as the coordinates are different.

cancel
Showing results for 
Search instead for 
Did you mean: