I have written the below watir code.
b.textarea.set text
It's configuring the text within the textarea, but when I attempt to print it, nothing appears. This is because the textarea node itself doesn't contain any text; however, one of the div elements beneath this textarea does. Even when I try to print that specific division using the XPath to locate it, it still doesn't display the expected text. This XPath is used because this particular division is where the text is being set.
//textarea/following-sibling::div[2]/div
But when I try to print it, it's not working either.
To get the text of a textarea, use the
#valuemethod:If you want to pull text from the following
div, your XPath does work. However, because the element is not visible and#textonly returns the visible text,#textwill return an empty string. You can use#text_contentto return all of the text nodes regardless of visibility: