I’m facing some issue, which I refuse to believe can’t be handled by Browser library.
The structure of the page is something like that:
<span1>
<span2>text</span2>
another text
</span2>
Now…
“GET TEXT //span1” retrieves textanothertext which is not good.
I was trying to use GET PROPERTY but properties which store another text value are not found by Browser (i.e. ChildNodes.NodeValue) or maybe I’m using it wrong.
I feel like I’m missing something really simple here…
I’ve only just started trying out browser library if I was to be honest from moving from seleniumlibrary, but from what I understand there’s no way of getting the text without that second span text value in this instance with Get Text and it’s acting as it should (could be wrong), it was pretty fun to play around with the Get Text and Get Property.
But what you could do in the mean time is: ${el} Get Element "insert_your_selector" ${value} Evaluate JavaScript ${el} (elem) => elem.firstChild.textContent
or ${value} Evaluate JavaScript ${el} (elem) => elem.firstChild.nextSibling.textContent