1

我们有使用 Canvas 和 GoJS 构建的图表应用程序。工具箱中有很多控件,我想将特定元素拖到空白区域。

我已经尝试通过操作方法,但这不起作用。

我试过代码:

actions.moveToElement(paletteCanvas, palette_node_x, palette_node_y);
        actions.clickAndHold();
        //Dragging selected node a little bit to make it work. 
        actions.moveToElement(paletteCanvas, palette_node_x, palette_node_y+50 );
        //Now perform the actual move
        actions.moveToElement(flowCanvas, diagramOffsetX , diagramOffsetY);
        actions.release();
        actions.perform();

也很难找到元素的偏移量。有什么方法可以让我使用 selenium 自动执行以下操作:

  1. 从工具箱拖放任何控件
  2. 从工具箱中选择任何特定控件

JSexecutor有可能工作吗?

4