我有一个页面进行测试,其中包含单击后添加的对象SVG。 就像:
启动框(默认添加) 那么我们可以添加更多的对象,这些对象将通过“砖形连接器”(线)进行连接
添加后,它会动态创建
<g _ngcontent-c6="" nea-sequence-editor-brick-connector="" _nghost-c8="" ng-reflect-brick-connector="[object Object]"><polyline _ngcontent-c8="" class="line strok1" points="160,120 160,170" style="stroke: rgb(128, 128, 128);"></polyline><polyline _ngcontent-c8="" class="line strok18" points="160,120 160,170" style="stroke: transparent;"></polyline><polygon _ngcontent-c8="" class="line strok1" points="155,165 160,170 165,165" style="stroke: rgb(128, 128, 128); fill: rgb(128, 128, 128);"></polygon></g>
<g _ngcontent-c6="" nea-sequence-editor-brick-connector="" _nghost-c8="" ng-reflect-brick-connector="[object Object]"><polyline _ngcontent-c8="" class="line strok1" points="160,370 160,410" style="stroke: rgb(128, 128, 128);"></polyline><polyline _ngcontent-c8="" class="line strok18" points="160,370 160,410" style="stroke: transparent;"></polyline><polygon _ngcontent-c8="" class="line strok1" points="155,405 160,410 165,405" style="stroke: rgb(128, 128, 128); fill: rgb(128, 128, 128);"></polygon></g>
<g _ngcontent-c6="" nea-sequence-editor-brick="" _nghost-c9="" ng-reflect-item="[object Object]"><!--bindings={
"ng-reflect-ng-if": "true"
}--><svg _ngcontent-c9="" class="nea-svg" x="110" y="20" width="100" height="100" style=""><rect _ngcontent-c9="" class="nea-svg-rect" fill="green" rx="25" ry="25" x="1" y="1" width="98" height="98"></rect><svg _ngcontent-c9="" height="200" width="200"><text _ngcontent-c9="" fill="white" style="font-size:14px" x="25" y="50">START</text></svg><circle _ngcontent-c9="" class="nea-svg-rect-circle" cx="50" cy="100" r="10"></circle></svg><!--bindings={
"ng-reflect-ng-if": "false"
}--></g>
<g _ngcontent-c6="" nea-sequence-editor-brick="" _nghost-c9="" ng-reflect-item="[object Object]"><!--bindings={
"ng-reflect-ng-if": "false"
}--><!--bindings={
"ng-reflect-ng-if": "true"
}--><svg _ngcontent-c9="" class="nea-svg" x="60" y="170" width="200" height="200"><rect _ngcontent-c9="" class="nea-svg-rect" rx="10" ry="10" ng-reflect-ng-style="[object Object]" x="1" y="1" width="198" height="198" style="stroke: rgba(85, 68, 153, 0.867); stroke-width: 4; fill: rgb(0, 114, 187);"></rect><text _ngcontent-c9="" fill="#fff" style="cursor:pointer" x="180" y="20">x</text><text _ngcontent-c9="" fill="white" style="font-size: 14px" x="10" y="20">System: AnalyseErrors</text><line _ngcontent-c9="" x1="2" x2="198" y1="30" y2="30" ng-reflect-ng-style="[object Object]" style="stroke: rgba(85, 68, 153, 0.867); stroke-width: 4;"></line><svg _ngcontent-c9="" class="nea-svg-rect-arg" height="200" width="200"><text _ngcontent-c9="" fill="white" style="font-size:14px" x="130" y="50">Result1</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="50">Parameter 1 </text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="130" y="70">6</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="70">Parameter 2: </text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="130" y="90">10</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="90">Parameter 3: </text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="130" y="110">left</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="110">Parmeter 4: </text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="130" y="135">Result3</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="135">Result : </text></svg><line _ngcontent-c9="" x1="2" x2="198" y1="145" y2="145" ng-reflect-ng-style="[object Object]" style="stroke: rgba(85, 68, 153, 0.867); stroke-width: 4;"></line><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="165">test</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="185">res2</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="50" y="185">=</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="65" y="185">10</text><circle _ngcontent-c9="" class="nea-svg-rect-circle" cx="100" cy="200" r="10"></circle></svg></g>
<g _ngcontent-c6="" nea-sequence-editor-brick="" _nghost-c9="" ng-reflect-item="[object Object]"><!--bindings={
"ng-reflect-ng-if": "false"
}--><!--bindings={
"ng-reflect-ng-if": "true"
}--><svg _ngcontent-c9="" class="nea-svg" x="60" y="410" width="200" height="200"><rect _ngcontent-c9="" class="nea-svg-rect" rx="10" ry="10" ng-reflect-ng-style="[object Object]" x="1" y="1" width="198" height="198" style="stroke: rgba(85, 68, 153, 0.867); stroke-width: 4; fill: rgb(0, 114, 187);"></rect><text _ngcontent-c9="" fill="#fff" style="cursor:pointer" x="180" y="20">x</text><text _ngcontent-c9="" fill="white" style="font-size: 14px" x="10" y="20">System: CheckAbortCycle</text><line _ngcontent-c9="" x1="2" x2="198" y1="30" y2="30" ng-reflect-ng-style="[object Object]" style="stroke: rgba(85, 68, 153, 0.867); stroke-width: 4;"></line><svg _ngcontent-c9="" class="nea-svg-rect-arg" height="200" width="200"><text _ngcontent-c9="" fill="white" style="font-size:14px" x="130" y="50">Result1</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="50">Parameter 1 </text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="130" y="70">6</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="70">Parameter 2: </text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="130" y="90">10</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="90">Parameter 3: </text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="130" y="110">left</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="110">Parmeter 4: </text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="130" y="135">Result3</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="135">Result : </text></svg><line _ngcontent-c9="" x1="2" x2="198" y1="145" y2="145" ng-reflect-ng-style="[object Object]" style="stroke: rgba(85, 68, 153, 0.867); stroke-width: 4;"></line><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="165">test</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="10" y="185">res2</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="50" y="185">=</text><text _ngcontent-c9="" fill="white" style="font-size:14px" x="65" y="185">10</text><circle _ngcontent-c9="" class="nea-svg-rect-circle" cx="100" cy="200" r="10"></circle></svg></g>
我试图选择每个对象,从框中获取所有字段并移动,
我在使用xpath和按类选择时遇到问题。
您有建议吗?
我正在考虑获取所有的类“ nea-svg”,每个类的文本。在此之后,我可能会得到所有相关的“ nea-sequence-editor-brick”。 由于这是一个很大的项目,我添加了一个扩展程序chrome,以获取xpath和CSS选择器,但是即使这样也无法检索正确的选择器。
我是量角器和茉莉花的新手。