0

这是需要先单击 div 而不是需要通过 sendKeys 发送值的视图

这是HTML检查时的代码

<svg _ngcontent-eda-c23="" class="ng-star-inserted" style="top: 535.5px; left: 367px; width: 34px; height: 18px;">
        <!---->
        <!---->
        <circle _ngcontent-eda-c23="" fill="rgba(0,0,0,0)" r="5" editor-control="element-anchor" editor-control-for="f2bc08a7-565f-448f-aa66-7447b1053ec8" editor-control-type="top-left" cx="0" cy="0" style="cursor: nwse-resize;" class="ng-star-inserted">
        </circle>
        <circle _ngcontent-eda-c23="" fill="#88c6ff" r="4" cx="0" cy="0" style="cursor: nwse-resize;" class="ng-star-inserted">
        </circle>
        <!---->
        <!---->
        <!---->
        <circle _ngcontent-eda-c23="" fill="rgba(0,0,0,0)" r="5" editor-control="element-anchor" editor-control-for="f2bc08a7-565f-448f-aa66-7447b1053ec8" editor-control-type="top-middle" cx="17" cy="0" style="cursor: ns-resize;" class="ng-star-inserted">
        </circle>
        <circle _ngcontent-eda-c23="" fill="#88c6ff" r="4" cx="17" cy="0" style="cursor: ns-resize;" class="ng-star-inserted">
        </circle>
        <!---->
        <!---->
        <!---->
        <circle _ngcontent-eda-c23="" fill="rgba(0,0,0,0)" r="5" editor-control="element-anchor" editor-control-for="f2bc08a7-565f-448f-aa66-7447b1053ec8" editor-control-type="top-right" cx="34" cy="0" style="cursor: nesw-resize;" class="ng-star-inserted">
        </circle>
        <circle _ngcontent-eda-c23="" fill="#88c6ff" r="4" cx="34" cy="0" style="cursor: nesw-resize;" class="ng-star-inserted">
        </circle>
        <!---->
        <!---->
        <!---->
        <circle _ngcontent-eda-c23="" fill="rgba(0,0,0,0)" r="5" editor-control="element-anchor" editor-control-for="f2bc08a7-565f-448f-aa66-7447b1053ec8" editor-control-type="middle-right" cx="34" cy="9" style="cursor: ew-resize;" class="ng-star-inserted">
        </circle>
        <circle _ngcontent-eda-c23="" fill="#88c6ff" r="4" cx="34" cy="9" style="cursor: ew-resize;" class="ng-star-inserted">
        </circle>
        <!---->
        <!---->
        <!---->
        <circle _ngcontent-eda-c23="" fill="rgba(0,0,0,0)" r="5" editor-control="element-anchor" editor-control-for="f2bc08a7-565f-448f-aa66-7447b1053ec8" editor-control-type="middle-left" cx="0" cy="9" style="cursor: ew-resize;" class="ng-star-inserted">
        </circle>
        <circle _ngcontent-eda-c23="" fill="#88c6ff" r="4" cx="0" cy="9" style="cursor: ew-resize;" class="ng-star-inserted">
        </circle>
        <!---->
        <!---->
        <!---->
        <circle _ngcontent-eda-c23="" fill="rgba(0,0,0,0)" r="5" editor-control="element-anchor" editor-control-for="f2bc08a7-565f-448f-aa66-7447b1053ec8" editor-control-type="bottom-left" cx="0" cy="18" style="cursor: nesw-resize;" class="ng-star-inserted">
        </circle>
        <circle _ngcontent-eda-c23="" fill="#88c6ff" r="4" cx="0" cy="18" style="cursor: nesw-resize;" class="ng-star-inserted">
        </circle>
        <!---->
        <!---->
        <!---->
        <circle _ngcontent-eda-c23="" fill="rgba(0,0,0,0)" r="5" editor-control="element-anchor" editor-control-for="f2bc08a7-565f-448f-aa66-7447b1053ec8" editor-control-type="bottom-middle" cx="17" cy="18" style="cursor: ns-resize;" class="ng-star-inserted">
        </circle>
        <circle _ngcontent-eda-c23="" fill="#88c6ff" r="4" cx="17" cy="18" style="cursor: ns-resize;" class="ng-star-inserted">
        </circle>
        <!---->
        <!---->
        <!---->
        <circle _ngcontent-eda-c23="" fill="rgba(0,0,0,0)" r="5" editor-control="element-anchor" editor-control-for="f2bc08a7-565f-448f-aa66-7447b1053ec8" editor-control-type="bottom-right" cx="34" cy="18" style="cursor: nwse-resize;" class="ng-star-inserted">
        </circle>
        <circle _ngcontent-eda-c23="" fill="#88c6ff" r="4" cx="34" cy="18" style="cursor: nwse-resize;" class="ng-star-inserted">
        </circle>
        <!---->
        <!---->
    </svg>
4

1 回答 1

1

您可能正在使用以下方法:

//NODE_NAME_YOU_ARE_LOOKING_UP[OTHER_FILTERS]

但是,当您在 html 页面中查找 svg 元素时,您需要使用以下模式:

//*[name()='NODE_NAME_YOU_ARE_LOOKING_UP' and OTHER_FILTERS]
于 2019-12-03T11:27:44.327 回答