简体   繁体   English

Java Selenium - 获取跨度值

[英]Java Selenium - get the span value

HTML Tag HTML 标签

<span class="slds-pill__label" data-aura-rendered-by="1508:0" xpath="1">jackson</span>

I want to get the value (jackson) in the above span我想获得上述跨度中的值(jackson)

I tried the below XPath, but I'm not getting the value我尝试了下面的 XPath,但我没有得到价值

//span[@class='slds-pill__label] with geText() its return empty
//span[@class='slds-pill__label] with getAttribute(value) ite return null

Please check the method name.请检查方法名称。 Have you written getText() or getext() in your code.您是否在代码中编写了 getText() 或 gettext() 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM