Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.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图像的Tootlip文本-Selenium Webdriver 使用此按钮显示/隐藏卡钳。显示卡钳时:单击并按住卡钳线以拖动它们。单击并按住卡钳测量以将两个卡钳拖动在一起。_Javascript_Html_Selenium_Selenium Webdriver_Selenium Chromedriver - Fatal编程技术网

Javascript 未获取svg图像的Tootlip文本-Selenium Webdriver 使用此按钮显示/隐藏卡钳。显示卡钳时:单击并按住卡钳线以拖动它们。单击并按住卡钳测量以将两个卡钳拖动在一起。

Javascript 未获取svg图像的Tootlip文本-Selenium Webdriver 使用此按钮显示/隐藏卡钳。显示卡钳时:单击并按住卡钳线以拖动它们。单击并按住卡钳测量以将两个卡钳拖动在一起。,javascript,html,selenium,selenium-webdriver,selenium-chromedriver,Javascript,Html,Selenium,Selenium Webdriver,Selenium Chromedriver,使用此按钮显示/隐藏卡钳。显示卡钳时:单击并按住卡钳线以拖动它们。单击并按住卡钳测量以将两个卡钳拖动在一起。 您可以尝试在工具提示显示时从中获取文本 <span id="tooltip" class="tooltip"> <svg class="svg-inline--fa fa-question-circle fa-w-16" data-fa-transform="grow-6" aria-hid


使用此按钮显示/隐藏卡钳。
显示卡钳时:
单击并按住卡钳线以拖动它们。
单击并按住卡钳测量以将两个卡钳拖动在一起。
您可以尝试在工具提示显示时从中获取文本

<span id="tooltip" class="tooltip">
<svg class="svg-inline--fa fa-question-circle fa-w-16" data-fa-transform="grow-6" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="question-circle" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" data-fa-i2svg="" style="transform-origin: 0.5em 0.5em;">
<g transform="translate(256 256)">
<g transform="translate(0, 0)  scale(1.375, 1.375)  rotate(0 0 0)">
<path fill="currentColor" d="M504 256c0 136.997-111.043 248-248 248S8 392.997 8 256C8 119.083 119.043 8 256 8s248 111.083 248 248zM262.655 90c-54.497 0-89.255 22.957-116.549 63.758-3.536 5.286-2.353 12.415 2.715 16.258l34.699 26.31c5.205 3.947 12.621 3.008 16.665-2.122 17.864-22.658 30.113-35.797 57.303-35.797 20.429 0 45.698 13.148 45.698 32.958 0 14.976-12.363 22.667-32.534 33.976C247.128 238.528 216 254.941 216 296v4c0 6.627 5.373 12 12 12h56c6.627 0 12-5.373 12-12v-1.333c0-28.462 83.186-29.647 83.186-106.667 0-58.002-60.165-102-116.531-102zM256 338c-25.365 0-46 20.635-46 46 0 25.364 20.635 46 46 46s46-20.636 46-46c0-25.365-20.635-46-46-46z" transform="translate(-256 -256)">
</path>
</g>
</g>
</svg>
<!-- <i class="fas fa-question-circle" data-fa-transform="grow-6"></i> -->
<span>Use this button to show/hide the calipers.<br>When the calipers are shown:<br>- Click and hold the caliper lines to drag them.<br>- Click and hold the caliper measurement to drag both calipers together.
</span>
</span>

工具提示文字是什么?这不是我的问题。悬停工具提示时,工具提示将在几秒钟内关闭,因此我无法读取工具提示消息。
Actions action = new Actions(driver);        
action.MoveToElement(ElementHandler.FindElement(By.XPath("//span[@id='tooltip']")).Perform();
            
WebElement toolTip = driver.findElement(By.xpath("//*[@id="tooltip"]"));
String toolTipText = toolTip.getText();
System.out.println("toolTipText-->"+toolTipText);