无法使用量角器定位svg类 [英] Unable to locate svg class using protractor

查看:84
本文介绍了无法使用量角器定位svg类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试查找具有条形图的Angular APP中存在的SVG类 以下是html块

I am trying to locate SVG class present in Angular APP having bar charts following is the html block

 <div class=" panel-body-style" _ngcontent-c1="">
   <table class="tabel bar-chart-table-fixed" _ngcontent-c1="">
     <tbody _ngcontent-c1="">
       <tr class="bar-chart-tr" _ngcontent-c1="">
         <td class="bar-label" _ngcontent-c1="">Assets ANR</td>
         <td id="bankwide-actual-chart" _ngcontent-c1="">
           <indium-charts _ngcontent-c1="" style="padding: 0px">
             <div id="holder" class="style-scope indium-charts">
               <svg class="bullet-bar-circle style-scope indium-charts" width="198" height="6.930000000000001">
             </div>
           </indium-charts>
         </td>
       </tr>

请让我知道如何在量角器中定位svg类

Please let me know how can we able to locate svg class in protractor

推荐答案

问题是硒存在处理SVG标签的问题. 处理SVG标签时,您只需要坚持使用cssSelector.

The Problem was selenium have an issue to handle SVG tags. You have to stick with only on cssSelector while dealing with SVG tags.

如果您只有一个id作为持有人,请在css选择器下面使用

If you have only one id as holder then use below css selector

#holder > svg

遍历g和rect

#holder > svg > g > rect

希望它会为您提供帮助

这篇关于无法使用量角器定位svg类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆