我可以单击所需的画布节点,但也需要在单击“+”按钮之前选择该节点。
//get a reference to the diagram object
const diagram = go.Diagram.fromDiv(document.getElementsByClassName("diagram-component")[0])
//using the diagram object find a node by name
const node = diagram.findNodesByExample({text: "capeutil"}).first()
//once you have the node you can expand it with the following command
node.findObject('ButtonButton').click(null, {part:node});需要帮助按文本选择节点
硒的实现
public void test_node_selection(String nodeName){
sleep(5);
JavascriptExecutor js = (JavascriptExecutor) context.getDriver();
js.executeScript(
"const diagram = go.Diagram.fromDiv(document.getElementsByClassName('diagram-component')[0]);" +
"const node = diagram.findNodesByExample({text: '" + nodeName + "'}).first()" +
"diagram.select(node);");
}发布于 2022-03-23 12:27:58
https://stackoverflow.com/questions/71586456
复制相似问题