首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在量角器中点击svg图标?

如何在量角器中点击svg图标?
EN

Stack Overflow用户
提问于 2019-03-26 17:52:07
回答 1查看 256关注 0票数 1

我需要点击这个图标来执行一些编辑功能。但是,我的代码无法定位此图标。有没有人能帮我找出这段代码的正确定位器?

代码语言:javascript
复制
<td _ngcontent-c29="" class="custom-td-action mat-cell cdk-column-action mat-column-action ng-star-inserted" mat-cell="" role="gridcell">
    <button _ngcontent-c29="" aria-haspopup="true" mat-icon-button="" class="mat-icon-button">
        <span class="mat-button-wrapper">
            <mat-icon _ngcontent-c29="" class="inv-icon-size--small mat-icon mat-icon-no-color" role="img" svgicon="inv-ellipsis-h" aria-hidden="true">
                <svg width="100%" height="100%" viewBox="0 0 17 3" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fit="" preserveAspectRatio="xMidYMid meet" focusable="false">
                    <!-- Generator: sketchtool 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
                    <title>E1FE60C0-EF43-4EE7-AF32-E28F60D7C746@1,5x</title>
                    <desc>Created with sketchtool.</desc>
                    <defs></defs>
                    <g id="UX-DESIGNER" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                        <g id="ui-03list_02--spec--product-type" transform="translate(-1493.000000, -589.000000)"
                            fill="#333333">
                            <g id="list/product-type-copy-2" transform="translate(255.000000, 547.000000)">
                                <g id="Group-10" transform="translate(185.000000, 18.000000)">
                                    <g id="package/list">
                                        <g id="ico/options" transform="translate(1053.000000, 24.000000)">
                                            <g id="Group-4">
                                                <circle id="Oval" cx="1.5" cy="1.5" r="1.5"></circle>
                                                <circle id="Oval-Copy" cx="8.5" cy="1.5" r="1.5"></circle>
                                                <circle id="Oval-Copy-2" cx="15.5" cy="1.5" r="1.5"></circle>
                                            </g>
                                        </g>
                                    </g>
                                </g>
                            </g>
                        </g>
                    </g>
                </svg>
            </mat-icon>
        </span>
        <div class="mat-button-ripple mat-ripple mat-button-ripple-round" matripple=""></div>
        <div class="mat-button-focus-overlay"></div>
    </button>
    <mat-menu _ngcontent-c29="" xposition="before" class="ng-tns-c9-43">
        <!---->
    </mat-menu>
</td>

无法单击svg图标以执行编辑功能。

EN

回答 1

Stack Overflow用户

发布于 2019-03-26 19:08:46

尝试以下xpath:

代码语言:javascript
复制
//button[@class='mat-icon-button']//mat-icon/*[name()='svg']
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55354134

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档