How to get a hidden text

Hello,

Is there a tip to get and assert a hidden text in div?

With Selenium, it works using Get Element Attribute id:myid textContent

I try both without success

   ${dec_text}  Get Text  css=div#myid     ==  The text to get

and

   ${dec_text}  Get Attribute  id=myid   textContent   ==  The text to get

sample:

<div style="visibility: hidden;">
<div id="myid">The text to get</div>
</div>

Thanks
Merry Christmas

Here is a solution I found to do it:

${dec_text} Evaluate JavaScript css=div#myid
… (element) => {var x = element.textContent;return x}

Should Be Equal As Strings ${dec_text} my expected string

May be a new keyword “Get Hidden Text” or an attribute “hidden” in “Get Text” may help

Regards