Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/463.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 无法使用量角器定位svg类_Javascript_Angularjs_Selenium Webdriver_Protractor - Fatal编程技术网

Javascript 无法使用量角器定位svg类

Javascript 无法使用量角器定位svg类,javascript,angularjs,selenium-webdriver,protractor,Javascript,Angularjs,Selenium Webdriver,Protractor,我正在尝试定位Angular应用程序中存在的SVG类,该类具有条形图 下面是html块 <div class=" panel-body-style" _ngcontent-c1=""> <table class="tabel bar-chart-table-fixed" _ngcontent-c1=""> <tbody _ngcontent-c1=""> <tr class="bar-chart-tr" _ngconten

我正在尝试定位Angular应用程序中存在的SVG类,该类具有条形图 下面是html块

 <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类。问题是,我们在处理svg标记时遇到了问题。 在处理SVG标记时,必须只使用cssSelector

如果您只有一个id作为持有者,则使用下面的css选择器

#holder > svg
用于遍历到g和rect

#holder > svg > g > rect

希望它能帮助你

我能找到带有$$(“SVG.bullet bar circle.style scope.indium charts”)的SVG,但我在里面有g类@shubam:我在chrome中得到了空数组,但在mozilla中它工作得很好,请尝试在使用此xpath之前等待一段时间。。首先使用线程。睡眠(10000);如果可行,请使用Webdriver等待解决问题。如果解决方案对您有效,请接受答案。我已经等待了,选择器在firefox上运行良好,但在chrom上运行不好,似乎问题在于您尝试了哪些解决方案?@PrashanthSams:没有任何解决方案吗?是的,我们可以看到这个页面吗?以防万一可以帮助你不,它将不可见,它是内部项目,我只是想知道如何在chrome中找到SVG的定位器,在fiirefox中工作的定位器在这里不工作,1点不在这里SVG在阴影根下