Hi,
We want to write selenium test cases on gojs diagram, which includes basic events like
a. clicking on a node/link
b. double click on a node/link
c. right click on a node/link
d. selecting a node/link.
As gojs is canvas based approach, Didn’t found any way to get the DOM elements of diagram elements.
But Using JavascriptExecutor we are able to get the elements from the diagram.
and able to perform select operation on a node/link, but not able to do remaining.
What’s the way to perform click, rightclick and doubleclick on nodes/links.
Our current approach is:
private WebDriver driver;
public void testGoJS() throws Exception {
// opening a webpage, which contains gojs diagram
driver.get(“http://www.gojs.net/latest/samples/basic.html”);
if (driver instanceof JavascriptExecutor) {
<span =“Apple-tab-span” style=“white-space:pre”> String code = "var key = myDiagram.model.nodeDataArray[1].key;
var node = myDiagram.findNodeForKey(key);
myDiagram.select(node) ";
<span =“Apple-tab-span” style=“white-space:pre”> ((JavascriptExecutor) driver).executeScript(code);
<span =“Apple-tab-span” style=“white-space:pre”>
<span =“Apple-tab-span” style=“white-space:pre”> }
}
Is there any better approach for selenium ?