2
<span id="spanHome" class="where-are-we" style="background-color: transparent;"> Home </span>

I want to get "Home" and returned. Which keyword should I use?

I tried:

${value}= Get Value //span[@id='spanHome']

But I always get None.

Jamal
  • 763
  • 7
  • 22
  • 32
Rocky Wang
  • 23
  • 1
  • 1
  • 4

1 Answers1

4

To get the text within a dom element, you need to use getText(). You are specifying getValue() which is synonymous with getAttribute("value").

Since your <span> element reveals text by it's innerHTML, instead of a value attribute, use getText()

ddavison
  • 28,221
  • 15
  • 85
  • 110